Skip to content

Commit

Permalink
Build/Test Tools: Update slackapi/slack-github-action.
Browse files Browse the repository at this point in the history
This makes the necessary changes to update the Slack GitHub Action to the latest version, currently `2.0.0`.

Most notably this update provides more control over how attempts re retried when rate limiting is encountered.

Reverts [59209].

See #61701, #62221.

git-svn-id: https://develop.svn.wordpress.org/trunk@59519 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Dec 16, 2024
1 parent 0530261 commit b670db9
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/slack-notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,66 +161,62 @@ jobs:
failure:
name: Failure notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ needs.prepare.outputs.previous_conclusion != 'first-failure' && inputs.calling_status == 'failure' || failure() }}

steps:
- name: Post failure notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

# Posts notifications the first time a workflow run succeeds after previously failing.
fixed:
name: Fixed notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ contains( fromJson( '["failure", "cancelled", "none"]' ), needs.prepare.outputs.previous_conclusion ) && inputs.calling_status == 'success' && success() }}

steps:
- name: Post failure notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}

# Posts notifications when a workflow is successful.
success:
name: Success notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ inputs.calling_status == 'success' && success() }}

steps:
- name: Post success notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}

# Posts notifications when a workflow is cancelled.
cancelled:
name: Cancelled notifications
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 5
timeout-minutes: 10
needs: [ prepare ]
if: ${{ inputs.calling_status == 'cancelled' || cancelled() }}

steps:
- name: Post cancelled notifications to Slack
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
webhook-type: webhook-trigger
webhook: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
payload: ${{ needs.prepare.outputs.payload }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}

0 comments on commit b670db9

Please sign in to comment.