diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 03e6277cd6..164642e1ad 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -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 }} diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index fc41233eda..16ad0c0f99 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -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 }} diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 073f5bbd49..a13a3b095e 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -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 }} diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 30b2f5f001..2121ddeb14 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -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 }} diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 22d98f3f4a..ef328a5761 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -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 }} diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index aa94445085..b75bc5b01d 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -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: diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 7d3cdbcd3d..cbf18067e9 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -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 }} diff --git a/.github/workflows/test-npm.yml b/.github/workflows/test-npm.yml index d2af984d25..207882513a 100644 --- a/.github/workflows/test-npm.yml +++ b/.github/workflows/test-npm.yml @@ -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 }} diff --git a/.github/workflows/test-old-branches.yml b/.github/workflows/test-old-branches.yml index 5d19130b26..7051b727d9 100644 --- a/.github/workflows/test-old-branches.yml +++ b/.github/workflows/test-old-branches.yml @@ -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 }}