Make WordPress Core

Changeset 59920


Ignore:
Timestamp:
03/03/2025 10:07:57 PM (2 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Remove redundant escaping from the commit message that's passed to the Slack API.

This escaping is no longer needed since all instances of inline expressions were removed from workflows in r59679. The commit message can now be treated as a plain text string in an environment variable throughout the workflow.

Props johnbillion, swissspidy

Unprops johnblackbourn

See #62221

File:
1 edited

Legend:

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

    r59720 r59920  
    136136          retries: 2
    137137          retry-exempt-status-codes: 418
     138          result-encoding: string
    138139          script: |
    139140            const commit_details = await github.rest.repos.getCommit({
     
    144145            return commit_details.data.commit.message;
    145146
    146       - name: Prepare commit message.
    147         id: commit-message
    148         run: |
    149           # shellcheck disable=SC2016
    150           COMMIT_MESSAGE="$(echo "${COMMIT_MSG_RAW}" | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g')"
    151           echo "commit_message_escaped=${COMMIT_MESSAGE}" >> "$GITHUB_OUTPUT"
    152         env:
    153           COMMIT_MSG_RAW: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}
    154 
    155147      - name: Construct payload and store as an output
    156148        id: create-payload
    157149        run: |
     150          COMMIT_MSG="$(echo "${COMMIT_MSG_RAW}" | awk 'NR==1')"
    158151          PAYLOAD="$( jq \
    159152            -n \
     
    166159          echo "payload=$PAYLOAD" >> "$GITHUB_OUTPUT"
    167160        env:
    168           COMMIT_MSG: ${{ steps.commit-message.outputs.commit_message_escaped }}
     161          COMMIT_MSG_RAW: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}
    169162
    170163  # Posts notifications when a workflow fails.
Note: See TracChangeset for help on using the changeset viewer.