WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/03/2021 01:45:02 PM (4 months ago)
Author:
desrosj
Message:

Build/Test Tools: Expand Slack notifications for GitHub Actions.

This expands Slack notifications to include success, cancelled, and “fixed” GitHub Action workflow run outcomes in addition to failures.

A “fixed” outcome occurs when the previous run for a workflow failed and the current one succeeds. This matches the behavior that was native to TravisCI by setting on_success for notifications to change.

The message details and where each outcome is posted is controlled by Slack workflows.

The Slack notification logic has also been pulled into a separate workflow to prevent repeating code in every workflow.

See #52644.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/welcome-new-contributors.yml

    r51511 r51535  
    5858
    5959            The WordPress Project
    60 
    61   # Post workflow related status updates to Slack.
    62   #
    63   # When a job in this workflow fails, a message is posted to #core.
    64   #
    65   # This job should always require all other jobs in this workflow to complete before running.
    66   slack-notifications:
    67     name: Slack Notifications
    68     runs-on: ubuntu-latest
    69     needs: [ post-welcome-message ]
    70     if: ${{ failure() }}
    71 
    72     steps:
    73       - name: Post failure notification to Slack
    74         uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
    75         with:
    76           payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
    77         env:
    78           SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
Note: See TracChangeset for help on using the changeset viewer.