3232 ver : ${{ steps.bundle-artifacts.outputs.ver }}
3333 git-rev : ${{ steps.bundle-artifacts.outputs.git-rev }}
3434 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 }}
3537 steps :
3638 - uses : actions/checkout@v4
3739 - name : The `release` branch must be up to date
@@ -110,28 +112,20 @@ jobs:
110112 name : bundle-artifacts
111113 path : bundle-artifacts
112114 - name : Publish announcement mail as a stand-alone artifact
113- id : announcement
115+ id : announcement-email
114116 uses : actions/upload-artifact@v4
115117 with :
116118 name : announcement
117119 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
127122 uses : actions/github-script@v7
128123 with :
129- github-token : ${{ steps.app-token.outputs.token }}
130124 script : |
131125 const gitSHA = ${{ toJson(steps.bundle-artifacts.outputs.git-rev) }}
132126 const tagName = ${{ toJson(steps.bundle-artifacts.outputs.tag-name) }}
133127 const ver = ${{ toJson(steps.bundle-artifacts.outputs.ver) }}
134- const announcementURL = ${{ toJson(steps.announcement.outputs.announcement ) }}
128+ const announcementURL = ${{ toJson(steps.announcement-email .outputs.artifact-url ) }}
135129
136130 const nth = (n) => {
137131 const suffix = ((n + 89) % 100) > 2 && ['th', 'st', 'nd', 'rd'][n % 10] || 'th'
@@ -142,7 +136,7 @@ jobs:
142136 const [, baseVersion, rc ] = ver.match(/^(.*)-rc(\d+)$/) || [ver]
143137 const skeet =
144138 rc
145- ? `The ${nth(Number.parseInt(rc) + 1)} release candidate of Git for Windows ${baseVersion} is available, please test! ${releaseURL}`
139+ ? `The ${nth(Number.parseInt(rc) + 1)} preview of Git for Windows ${baseVersion} is available, please test! ${releaseURL}`
146140 : `Git for Windows ${baseVersion} is available! ${releaseURL}`
147141 const blueskyLink = `https://bsky.app/intent/compose?text=${encodeURIComponent(skeet)}`
148142
@@ -152,16 +146,11 @@ jobs:
152146 const { data } = await github.rest.search.issuesAndPullRequests({ q })
153147 if (data.items.length === 1) {
154148 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}`)
163152 } 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}`)
165154 }
166155 github-release :
167156 needs : ['setup']
@@ -183,6 +172,8 @@ jobs:
183172 git_artifacts_i686_workflow_run_id : ${{ env.I686_WORKFLOW_RUN_ID }}
184173 git_artifacts_x86_64_workflow_run_id : ${{ env.X86_64_WORKFLOW_RUN_ID }}
185174 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 }}
186177 gitforwindows-site :
187178 needs : ['setup', 'github-release']
188179 runs-on : ubuntu-latest
0 commit comments