diff --git a/.github/workflows/additional.yml b/.github/workflows/additional.yml index df382a848..7eefd1ca0 100644 --- a/.github/workflows/additional.yml +++ b/.github/workflows/additional.yml @@ -30,3 +30,35 @@ jobs: - uses: actions/checkout@v5 - uses: prefix-dev/setup-pixi@v0.9.0 - run: pixi run docs-linkcheck + + create-issue-on-failure: + name: Create issue on failure + runs-on: ubuntu-latest + needs: [min-version-policy, linkcheck] + if: failure() && github.event_name == 'schedule' + permissions: + issues: write + steps: + - name: Create issue + uses: actions/github-script@v7 + with: + script: | + const workflowUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const title = `CI Additional workflow failed - ${new Date().toISOString().split('T')[0]}`; + const body = `The [CI Additional workflow](${workflowUrl}) failed on its scheduled run. + + **Workflow Run:** ${context.runId} + **Trigger:** ${context.eventName} + **Branch:** ${context.ref} + + Please investigate the failure and fix the issues. + + _This issue was automatically created by the workflow._`; + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: title, + body: body, + labels: ['bug', 'automated'] + });