Make WordPress Core


Ignore:
Timestamp:
10/25/2021 08:26:45 PM (3 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/slack-notifications.yml

    r51934 r51937  
    119119      - name: Construct payload and store as an output
    120120        id: create-payload
    121         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 }}\"}"
     121        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 }}\"}"
    122122
    123123  # Posts notifications when a workflow fails.
Note: See TracChangeset for help on using the changeset viewer.