@@ -2,6 +2,8 @@ name: Release Nightly
2
2
on :
3
3
push :
4
4
branches : [v2]
5
+ pull_request :
6
+ branches : [v2]
5
7
concurrency :
6
8
group : ${{ github.workflow }}-${{ github.ref }}
7
9
cancel-in-progress : true
15
17
name : Release
16
18
runs-on : ubuntu-24.04
17
19
strategy :
20
+ fail-fast : true
18
21
matrix :
19
22
release :
20
23
- release-all-in-one-nightly
@@ -47,13 +50,59 @@ jobs:
47
50
slack-notify-failure :
48
51
needs : release
49
52
runs-on : ubuntu-24.04
50
- if : failure()
53
+ if : failure() && always()
51
54
steps :
55
+ - name : Checkout
56
+ uses : actions/checkout@v4
57
+
58
+ - name : Get failed jobs
59
+ id : get_failed_jobs
60
+ uses : actions/github-script@v7
61
+ with :
62
+ github-token : ${{ secrets.GITHUB_TOKEN }}
63
+ script : |
64
+ const response = await github.rest.actions.listJobsForWorkflowRun({
65
+ owner: context.repo.owner,
66
+ repo: context.repo.repo,
67
+ run_id: context.runId
68
+ });
69
+
70
+ const failedJobs = response.data.jobs
71
+ .filter(job => job.status === 'completed' && job.conclusion === 'failure')
72
+ .map(job => job.name)
73
+ .join(', ');
74
+
75
+ core.setOutput('failed_jobs', failedJobs);
76
+
52
77
- name : Slack Notification
53
78
uses : 8398a7/action-slack@v3
54
79
with :
55
- status : ${{ job.status }}
56
- fields : repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message)
80
+ status : custom
81
+ fields : repo,workflow,commit,author
82
+ custom_payload : |
83
+ {
84
+ "text": "Release Nightly Failed 😔",
85
+ "attachments": [{
86
+ "color": "danger",
87
+ "fields": [
88
+ {
89
+ "title": "Failed Build",
90
+ "value": "${{ steps.get_failed_jobs.outputs.failed_jobs }}",
91
+ "short": false
92
+ },
93
+ {
94
+ "title": "Commit",
95
+ "value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>",
96
+ "short": false
97
+ },
98
+ {
99
+ "title": "Author",
100
+ "value": "${{ github.actor }}",
101
+ "short": true
102
+ }
103
+ ]
104
+ }]
105
+ }
57
106
env :
58
107
SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL_ENG_NOTIFS }}
59
108
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments