WordPress.org

Make WordPress Core

Changeset 51647


Ignore:
Timestamp:
08/20/2021 06:58:18 PM (4 months ago)
Author:
desrosj
Message:

Build/Test Tools: Include the commit short summary in Slack messages.

This gives more context to GitHub Action related Slack messages without the need to click the workflow URL, or unfurl the links (which shows lots of unnecessary information, such as the repository description and image).

Props earnjam.
See #52644.

File:
1 edited

Legend:

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

    r51558 r51647  
    6161        run: echo "::set-output name=previous_conclusion::${{ steps.previous-result.outputs.result }}"
    6262
     63      - name: Prepare commit message.
     64        id: commit-message
     65        run: |
     66          COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/\"/\\"/g'
     67          ${{ github.event.workflow_run.head_commit.message }}
     68          EOF
     69          )
     70          echo "::set-output name=commit_message_escaped::${COMMIT_MESSAGE}"
     71
    6372      - name: Construct payload and store as an output
    6473        id: create-payload
    65         run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github.event.workflow_run.name }}\",\"ref_name\":\"${{ github.event.workflow_run.head_branch }}\",\"run_url\":\"${{ github.event.workflow_run.html_url }}\"}"
     74        run: echo "::set-output name=payload::{\"workflow_name\":\"${{ github.event.workflow_run.name }}\",\"ref_name\":\"${{ github.event.workflow_run.head_branch }}\",\"run_url\":\"${{ github.event.workflow_run.html_url }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}"
    6675
    6776  # Posts notifications when a workflow fails.
Note: See TracChangeset for help on using the changeset viewer.