mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Build/Test Tools: Use the correct workflow name in notifications on workflow_run
.
When a workflow is triggered through a `workflow_run` event, the context is not the original workflow. The details about the original workflow are passed through the `github.event` context. This also moves the conditional check controlling whether the Slack workflow is run into the calling workflows to prevent them from running for pull requests. Follow up to [51921-51922,51924-51925,51934]. See #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@51937 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
22bb0fee98
commit
e1eb18d5df
2
.github/workflows/coding-standards.yml
vendored
2
.github/workflows/coding-standards.yml
vendored
@ -151,7 +151,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ phpcs, jshint ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/end-to-end-tests.yml
vendored
2
.github/workflows/end-to-end-tests.yml
vendored
@ -121,7 +121,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ e2e-tests ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/javascript-tests.yml
vendored
2
.github/workflows/javascript-tests.yml
vendored
@ -90,7 +90,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ test-js ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/php-compatibility.yml
vendored
2
.github/workflows/php-compatibility.yml
vendored
@ -92,7 +92,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ php-compatibility ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/phpunit-tests.yml
vendored
2
.github/workflows/phpunit-tests.yml
vendored
@ -247,7 +247,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ test-php ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/slack-notifications.yml
vendored
2
.github/workflows/slack-notifications.yml
vendored
@ -118,7 +118,7 @@ jobs:
|
||||
|
||||
- name: Construct payload and store as an output
|
||||
id: create-payload
|
||||
run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github.workflow }}\",\"ref_name\":\"${{ env.CURRENT_BRANCH }}\",\"run_url\":\"${{ github.event_name == 'workflow_run' && github.event.workflow_run.html_url || steps.current-workflow-url.outputs.result }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}"
|
||||
run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github.event_name == 'workflow_run' && github.event.workflow_run.name || github.workflow }}\",\"ref_name\":\"${{ env.CURRENT_BRANCH }}\",\"run_url\":\"${{ github.event_name == 'workflow_run' && github.event.workflow_run.html_url || steps.current-workflow-url.outputs.result }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}"
|
||||
|
||||
# Posts notifications when a workflow fails.
|
||||
failure:
|
||||
|
2
.github/workflows/test-coverage.yml
vendored
2
.github/workflows/test-coverage.yml
vendored
@ -173,7 +173,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ test-coverage-report ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/test-npm.yml
vendored
2
.github/workflows/test-npm.yml
vendored
@ -159,7 +159,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ test-npm, test-npm-macos ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
2
.github/workflows/test-old-branches.yml
vendored
2
.github/workflows/test-old-branches.yml
vendored
@ -74,7 +74,7 @@ jobs:
|
||||
name: Slack Notifications
|
||||
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
|
||||
needs: [ dispatch-workflows-for-old-branches ]
|
||||
if: ${{ always() }}
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user