CI Failure Issue #4876
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Failure Issue | |
| on: | |
| workflow_run: | |
| # These names must match the `name:` field in each workflow file exactly | |
| workflows: | |
| - 'Build and Test' | |
| - 'Quality and Safety Checks' | |
| - 'E2E Tests (Full Suite)' | |
| - 'CodeQL' | |
| types: [completed] | |
| jobs: | |
| create-issue: | |
| concurrency: ci-failure-issue-${{ github.event.workflow_run.name }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.head_branch == 'main' }} | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20.x' | |
| - name: Generate GitHub App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Create CI failure issue | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| WORKFLOW_NAME: ${{ github.event.workflow_run.name }} | |
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | |
| RUN_URL: ${{ github.event.workflow_run.html_url }} | |
| run: | | |
| npx -y tsx .github/scripts/create-failure-issue.ts \ | |
| --title-prefix "CI Failure" \ | |
| --name "$WORKFLOW_NAME" \ | |
| --branch "$HEAD_BRANCH" \ | |
| --commit "$HEAD_SHA" \ | |
| --run-url "$RUN_URL" \ | |
| --labels "high-severity,ci" |