Skip to content

Commit 45fa709

Browse files
committed
Build/Test Tools: Add Slack notifications and auto-retry to linting workflow.
See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@60082 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ce20ad7 commit 45fa709

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/workflow-lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,52 @@ jobs:
3838
security-events: write
3939
actions: read
4040
contents: read
41+
42+
slack-notifications:
43+
name: Slack Notifications
44+
uses: ./.github/workflows/slack-notifications.yml
45+
permissions:
46+
actions: read
47+
contents: read
48+
needs: [ lint ]
49+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
50+
with:
51+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
52+
secrets:
53+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
54+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
55+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
56+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
57+
58+
failed-workflow:
59+
name: Failed workflow tasks
60+
runs-on: ubuntu-24.04
61+
permissions:
62+
actions: write
63+
needs: [ slack-notifications ]
64+
if: |
65+
always() &&
66+
github.repository == 'WordPress/wordpress-develop' &&
67+
github.event_name != 'pull_request' &&
68+
github.run_attempt < 2 &&
69+
(
70+
contains( needs.*.result, 'cancelled' ) ||
71+
contains( needs.*.result, 'failure' )
72+
)
73+
74+
steps:
75+
- name: Dispatch workflow run
76+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
77+
with:
78+
retries: 2
79+
retry-exempt-status-codes: 418
80+
script: |
81+
github.rest.actions.createWorkflowDispatch({
82+
owner: context.repo.owner,
83+
repo: context.repo.repo,
84+
workflow_id: 'failed-workflow.yml',
85+
ref: 'trunk',
86+
inputs: {
87+
run_id: `${context.runId}`,
88+
}
89+
});

0 commit comments

Comments
 (0)