Changeset 59679 for trunk/.github/workflows/slack-notifications.yml
- Timestamp:
- 01/22/2025 03:13:21 PM (21 months ago)
- File:
-
- 1 edited
-
trunk/.github/workflows/slack-notifications.yml (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/slack-notifications.yml
r59519 r59679 55 55 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event.workflow_run.event != 'pull_request' }} 56 56 outputs: 57 previous_conclusion: ${{ steps.previous- conclusion.outputs.previous_conclusion}}57 previous_conclusion: ${{ steps.previous-attempt-result.outputs.result }} 58 58 payload: ${{ steps.create-payload.outputs.payload }} 59 59 … … 69 69 owner: context.repo.owner, 70 70 repo: context.repo.repo, 71 run_id: ${{ github.run_id }},71 run_id: context.runId, 72 72 }); 73 73 74 if ( '${{ inputs.calling_status }}'== 'failure' && workflow_run.data.run_attempt == 1 ) {74 if ( process.env.CALLING_STATUS == 'failure' && workflow_run.data.run_attempt == 1 ) { 75 75 return 'first-failure'; 76 76 } … … 83 83 owner: context.repo.owner, 84 84 repo: context.repo.repo, 85 run_id: ${{ github.run_id }},85 run_id: context.runId, 86 86 attempt_number: workflow_run.data.run_attempt - 1 87 87 }); … … 95 95 repo: context.repo.repo, 96 96 workflow_id: workflow_run.data.workflow_id, 97 branch: '${{ env.CURRENT_BRANCH }}',97 branch: process.env.CURRENT_BRANCH, 98 98 exclude_pull_requests: true, 99 99 }); … … 125 125 // Can't determine previous workflow conclusion. 126 126 return 'unknown'; 127 128 - name: Store previous conclusion as an output 129 id: previous-conclusion 130 run: echo "previous_conclusion=${{ steps.previous-attempt-result.outputs.result }}" >> $GITHUB_OUTPUT 127 env: 128 CALLING_STATUS: ${{ inputs.calling_status }} 131 129 132 130 - name: Get the commit message … … 141 139 owner: context.repo.owner, 142 140 repo: context.repo.repo, 143 ref: '${{ github.sha }}'141 ref: context.sha, 144 142 }); 145 143 return commit_details.data.commit.message; … … 148 146 id: commit-message 149 147 run: | 150 COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g'151 ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}152 EOF153 )154 echo "commit_message_escaped=${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT148 # shellcheck disable=SC2016 149 COMMIT_MESSAGE="$(echo "${COMMIT_MSG_RAW}" | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g')" 150 echo "commit_message_escaped=${COMMIT_MESSAGE}" >> "$GITHUB_OUTPUT" 151 env: 152 COMMIT_MSG_RAW: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }} 155 153 156 154 - name: Construct payload and store as an output 157 155 id: create-payload 158 run: echo "payload={\"workflow_name\":\"${{ github.workflow }}\",\"ref_name\":\"${{ env.CURRENT_BRANCH }}\",\"run_url\":\"https://github.com/WordPress/wordpress-develop/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}" >> $GITHUB_OUTPUT 156 run: | 157 PAYLOAD="$( jq \ 158 -n \ 159 --arg workflow_name "${GITHUB_WORKFLOW}" \ 160 --arg ref_name "${CURRENT_BRANCH}" \ 161 --arg run_url "https://github.com/WordPress/wordpress-develop/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}" \ 162 --arg commit_message "${COMMIT_MSG}" \ 163 '{workflow_name: $workflow_name, ref_name: $ref_name, run_url: $run_url, commit_message: $commit_message}' 164 )" 165 echo "payload=$PAYLOAD" >> "$GITHUB_OUTPUT" 166 env: 167 COMMIT_MSG: ${{ steps.commit-message.outputs.commit_message_escaped }} 159 168 160 169 # Posts notifications when a workflow fails. 161 170 failure: 162 171 name: Failure notifications 172 permissions: {} 163 173 runs-on: ubuntu-latest 164 174 timeout-minutes: 10 … … 177 187 fixed: 178 188 name: Fixed notifications 189 permissions: {} 179 190 runs-on: ubuntu-latest 180 191 timeout-minutes: 10 … … 193 204 success: 194 205 name: Success notifications 206 permissions: {} 195 207 runs-on: ubuntu-latest 196 208 timeout-minutes: 10 … … 209 221 cancelled: 210 222 name: Cancelled notifications 223 permissions: {} 211 224 runs-on: ubuntu-latest 212 225 timeout-minutes: 10
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)