From 62eef9c457a04f2dbc3386e5a8ad9de81da0184a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 11:41:35 +0100 Subject: [PATCH] Fail check on error, format message --- .github/workflows/missing-ops.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index e6fa0e2..cb0181f 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -24,6 +24,7 @@ jobs: continue-on-error: true outputs: should_notify: ${{ steps.check_status.outputs.result }} + job_id: ${{ job.container.id }} steps: - uses: actions/checkout@v4 - uses: mozilla-actions/sccache-action@v0.0.6 @@ -60,10 +61,24 @@ jobs: if: ${{ needs.missing-optypes.outputs.should_notify == 'true' }} with: channel-id: 'C04SHCL4FKP' - slack-message: '`tket-json-rs` is missing OpType definitions. See the failing check for more info.\nhttps://github.com/CQCL/tket-json-rs/actions/workflows/missing-ops.yml' + slack-message: | + `tket-json-rs` is missing OpType definitions. + See for more info. + # https://github.com/CQCL/tket-json-rs/actions/runs/11516498588/job/32059316409?pr=84 # An unique identifier for the message type, to use in rate limiting. message-label: "missing-op" # Rate-limit the message to once per week timeout-minutes: 10080 secrets: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + # This is required since `missing-optypes` is set to continue-on-error, + # and we want to ultimately fail the check after notifying. + fail-on-missing-optypes: + name: Fail the build on missing op types + runs-on: ubuntu-latest + needs: missing-optypes + if: ${{ needs.missing-optypes.outputs.should_notify == 'true' }} + steps: + - name: Fail the build + run: exit 1 \ No newline at end of file