From 188a12f609a19ffca9a192213dd44c2a2d4e7ee2 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Thu, 7 Aug 2025 18:17:00 +0100 Subject: [PATCH] CI: Add raising GitHub issue on failure of scheduled RTLMeter job (#6270) --- .github/workflows/rtlmeter.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/rtlmeter.yml b/.github/workflows/rtlmeter.yml index e4d7a9eb3..94cfa153b 100644 --- a/.github/workflows/rtlmeter.yml +++ b/.github/workflows/rtlmeter.yml @@ -181,6 +181,7 @@ jobs: private-key: ${{ secrets.RTLMETER_RESULTS_CI_APP_PRIVATE_KEY }} owner: verilator repositories: verilator-rtlmeter-results + permission-contents: write - name: Checkout verilator-rtlmeter-results uses: actions/checkout@v4 with: @@ -205,3 +206,31 @@ jobs: git add . git commit -m "Verilator CI: Results of 'RTLMeter' workflow run #${{ github.run_number }}" git push origin + + # Create GitHub issue for failed schedueld jobs + # This should always be the last job (we want an issue if anything breaks) + create-issue: + name: Create issue on failure + needs: publish-results + if: ${{ github.event_name == 'schedule' && github.repository == 'verilator/verilator' && github.run_attempt == 1 && !cancelled() }} + runs-on: ubuntu-24.04 + steps: + # Creating issues requires elevated privilege + - name: Generate access token + id: generate-token + uses: actions/create-github-app-token@v2.0.6 + with: + app-id: ${{ vars.RTLMETER_RESULTS_CI_APP_ID }} + private-key: ${{ secrets.RTLMETER_RESULTS_CI_APP_PRIVATE_KEY }} + owner: verilator + repositories: verilator + permission-issues: write + - name: Create issue + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + gh issue --repo ${{ github.repository }} create \ + --title "Testing - RTLMeter run #${{ github.run_number}} Failed" \ + --body "See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + --label new \ + --assignee gezalore,wsnyder