-
-
Notifications
You must be signed in to change notification settings - Fork 725
165 lines (149 loc) · 5.41 KB
/
Copy pathon_comment.yaml
File metadata and controls
165 lines (149 loc) · 5.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: "On Comment"
on:
issue_comment:
types: [created]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
# This job always runs to prevent GHA from marking the run as failed when
# all other jobs are skipped.
noop:
runs-on: ubuntu-latest
steps:
- run: echo "No-op"
parse_comment:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/')
outputs:
command: ${{ steps.parse.outputs.command }}
issue_number: ${{ steps.parse.outputs.issue_number }}
pr_number: ${{ steps.parse.outputs.pr_number }}
backports: ${{ steps.parse.outputs.backports }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Parse comment
id: parse
env:
COMMENT_BODY: ${{ github.event.comment.body }}
IS_PR: "${{ github.event.issue.pull_request != null }}"
EVENT_NUMBER: "${{ github.event.issue.number }}"
HAS_RELEASE_LABEL: "${{ contains(github.event.issue.labels.*.name, 'type: release') }}"
HAS_BACKPORT_LABEL: "${{ contains(github.event.issue.labels.*.name, 'type: backport-pr') }}"
COMMENT_ID: "${{ github.event.comment.id }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/workflows/on_comment.py
call_create_rc:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'create-rc'
uses: ./.github/workflows/release_create_rc.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
comment_id: "${{ github.event.comment.id }}"
secrets: inherit
call_prepare_complete:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'prepare-complete'
uses: ./.github/workflows/release_complete_prepare.yaml
with:
pr: ${{ needs.parse_comment.outputs.pr_number }}
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_create_release_branch:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'create-release-branch'
uses: ./.github/workflows/release_create_release_branch.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_prepare:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'prepare'
uses: ./.github/workflows/release_prepare.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_add_backports:
needs: parse_comment
if: |
needs.parse_comment.outputs.command == 'add-backports' ||
needs.parse_comment.outputs.command == 'pr-backport'
uses: ./.github/workflows/release_add_backports.yaml
with:
prs: ${{ needs.parse_comment.outputs.command == 'pr-backport' && needs.parse_comment.outputs.pr_number || needs.parse_comment.outputs.backports }}
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_process_backports_after_add:
needs: [parse_comment, call_add_backports]
if: needs.parse_comment.outputs.command == 'add-backports'
uses: ./.github/workflows/release_process_backports.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
comment_id: "${{ github.event.comment.id }}"
secrets: inherit
call_process_backports_only:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'process-backports'
uses: ./.github/workflows/release_process_backports.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
comment_id: "${{ github.event.comment.id }}"
secrets: inherit
call_sync_changelog:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'sync-changelog'
uses: ./.github/workflows/release_sync_changelog.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_promote:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'promote'
uses: ./.github/workflows/release_promote.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_backport_prepare:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'backport-prepare'
uses: ./.github/workflows/backport_prepare.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
call_backport_create_releases:
needs: parse_comment
if: needs.parse_comment.outputs.command == 'backport-create-releases'
uses: ./.github/workflows/backport_create_releases.yaml
with:
issue: ${{ needs.parse_comment.outputs.issue_number }}
secrets: inherit
report_failure:
needs:
- parse_comment
- call_create_rc
- call_prepare_complete
- call_create_release_branch
- call_prepare
- call_add_backports
- call_process_backports_after_add
- call_process_backports_only
- call_sync_changelog
- call_promote
- call_backport_prepare
- call_backport_create_releases
if: always() && contains(needs.*.result, 'failure')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Post failure comment
env:
COMMAND: "${{ needs.parse_comment.outputs.command }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/workflows/on_comment.py --report-failure