WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/29/2021 07:47:43 PM (3 months ago)
Author:
desrosj
Message:

Build/Test Tools: Post a message to #core in Slack when a workflow fails.

This adds an additional step to each GitHub Action workflow file that posts a message to #core in Slack every time a workflow run fails.

A minor test and spacing change is included in this commit in order to that messages are posted correctly and will be reverted after testing.

See #52644.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/test-old-branches.yml

    r51498 r51511  
    7070              ref: '${{ matrix.branch }}'
    7171            });
     72
     73  # Post workflow related status updates to Slack.
     74  #
     75  # When a job in this workflow fails, a message is posted to #core.
     76  #
     77  # This job should always require all other jobs in this workflow to complete before running.
     78  slack-notifications:
     79    name: Slack Notifications
     80    runs-on: ubuntu-latest
     81    needs: [ dispatch-workflows-for-old-branches ]
     82    if: ${{ failure() }}
     83
     84    steps:
     85      - name: Post failure notification to Slack
     86        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     87        with:
     88          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     89        env:
     90          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
Note: See TracChangeset for help on using the changeset viewer.