32
32
ver : ${{ steps.bundle-artifacts.outputs.ver }}
33
33
git-rev : ${{ steps.bundle-artifacts.outputs.git-rev }}
34
34
release-notes : ${{ steps.bundle-artifacts.outputs.release-notes }}
35
+ pull-request-number : ${{ steps.announcement.outputs.pull-request-number }}
36
+ pull-request-comment : ${{ steps.announcement.outputs.pull-request-comment }}
35
37
steps :
36
38
- uses : actions/checkout@v4
37
39
- name : The `release` branch must be up to date
@@ -110,28 +112,20 @@ jobs:
110
112
name : bundle-artifacts
111
113
path : bundle-artifacts
112
114
- name : Publish announcement mail as a stand-alone artifact
113
- id : announcement
115
+ id : announcement-email
114
116
uses : actions/upload-artifact@v4
115
117
with :
116
118
name : announcement
117
119
path : bundle-artifacts/announce-*
118
- - uses : actions/create-github-app-token@v1
119
- id : app-token
120
- with :
121
- app-id : ${{ secrets.GH_APP_ID }}
122
- private-key : ${{ secrets.GH_APP_PRIVATE_KEY }}
123
- owner : ${{ env.OWNER }}
124
- repositories : |
125
- ${{ env.REPO }}
126
- - name : Add a comment about the announcement email to the Pull Request
120
+ - name : Prepare a comment about the announcement email to the Pull Request
121
+ id : announcement
127
122
uses : actions/github-script@v7
128
123
with :
129
- github-token : ${{ steps.app-token.outputs.token }}
130
124
script : |
131
125
const gitSHA = ${{ toJson(steps.bundle-artifacts.outputs.git-rev) }}
132
126
const tagName = ${{ toJson(steps.bundle-artifacts.outputs.tag-name) }}
133
127
const ver = ${{ toJson(steps.bundle-artifacts.outputs.ver) }}
134
- const announcementURL = ${{ toJson(steps.announcement.outputs.artifact-url) }}
128
+ const announcementURL = ${{ toJson(steps.announcement-email .outputs.artifact-url) }}
135
129
136
130
const nth = (n) => {
137
131
const suffix = ((n + 89) % 100) > 2 && ['th', 'st', 'nd', 'rd'][n % 10] || 'th'
@@ -152,16 +146,11 @@ jobs:
152
146
const { data } = await github.rest.search.issuesAndPullRequests({ q })
153
147
if (data.items.length === 1) {
154
148
const author = data.items[0].user.login
155
- const req = {
156
- owner: process.env.OWNER,
157
- repo: process.env.REPO,
158
- issue_number: data.items[0].number,
159
- body: `@${author}, ${body}`,
160
- }
161
-
162
- await github.rest.issues.createComment(req)
149
+ core.setOutput('pull-request-number', data.items[0].number)
150
+ core.setOutput('pull-request-comment', `@${author}, ${body}`)
151
+ core.info(`Prepared a comment to add to ${data.items[0].html_url}:\n@${author}, ${body}`)
163
152
} else {
164
- core.warning(`${data.items.length} PRs found for ${gitSHA}, not posting a comment, would have posted\n${body}`)
153
+ core.warning(`${data.items.length} PRs found for ${gitSHA}, not posting a comment, would have posted: \n${body}`)
165
154
}
166
155
github-release :
167
156
needs : ['setup']
@@ -183,6 +172,8 @@ jobs:
183
172
git_artifacts_i686_workflow_run_id : ${{ env.I686_WORKFLOW_RUN_ID }}
184
173
git_artifacts_x86_64_workflow_run_id : ${{ env.X86_64_WORKFLOW_RUN_ID }}
185
174
git_artifacts_aarch64_workflow_run_id : ${{ env.AARCH64_WORKFLOW_RUN_ID }}
175
+ pull-request-number : ${{ needs.setup.outputs.pull-request-number }}
176
+ pull-request-comment : ${{ needs.setup.outputs.pull-request-comment }}
186
177
gitforwindows-site :
187
178
needs : ['setup', 'github-release']
188
179
runs-on : ubuntu-latest
0 commit comments