Skip to content

Commit

Permalink
Fail check on error, format message
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Oct 25, 2024
1 parent 8273c11 commit 1208525
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/missing-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
continue-on-error: true
outputs:
should_notify: ${{ steps.check_status.outputs.result }}
job_id: ${{ job }}
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
Expand Down Expand Up @@ -60,10 +61,23 @@ 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 <https://github.com/CQCL/tket-json-rs/actions/runs/${{ github.run_id }}/job/${{ needs.missing-optypes.outputs.job_id }}|the failing check> for more info.
# 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 }}
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

0 comments on commit 1208525

Please sign in to comment.