Skip to content

Commit 0c9a959

Browse files
committed
deploy: do open/close issues about broken links
There is specific code in git-scm.com's deploy workflow to open a ticket whenever broken links were detected, and to close such a ticket when no broken links were detected. However, as per lycheeverse/lychee-action#265 the way we checked for this was incorrect: `env.lychee_exit_code` had was correct, until lycheeverse/lychee-action#245 broke it by way of fixing another bug. This was the reason why the broken link that was found and reported in https://github.com/git/git-scm.com/actions/runs/13544529063/job/37852881418#step:3:135319 never made it into a GitHub issue, even if that had been the intention. For the record, I worked on a fix for this broken link and opened jnavila/git-manpages-l10n#131 to incorporate that fix. What prevented this broken link from being detected before above-mentioned deployment is the fact that before git#1953 was merged, the `git-scm.com` deployment used `http://` in the base URL, and hence the `--remap` option used in the deployment workflow mapped all http://git-scm.com links to local files, whereas now the `https://` base URL is used and https://git-scm.com links are mapped, including the offending one. In any case let's fix opening/closing the "broken link" issues. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 88ad648 commit 0c9a959

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/actions/deploy-to-github-pages/action.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ runs:
176176
fail: false
177177
failIfEmpty: false # needed because its default overrides `fail = false`
178178

179-
- name: ${{ env.lychee_exit_code != '0' && 'open or update' || 'maybe close' }} link checker issue
180-
if: env.lychee_exit_code != ''
179+
- name: ${{ steps.lychee.outputs.exit_code != '0' && 'open or update' || 'maybe close' }} link checker issue
181180
uses: actions/github-script@v7
182181
with:
183182
github-token: ${{ inputs.github-token }}
@@ -211,13 +210,13 @@ runs:
211210
})()
212211
213212
if (issues.data.items.length === 0) {
214-
if (process.env.lychee_exit_code !== '0') {
213+
if ('${{ steps.lychee.outputs.exit_code }}' !== '0') {
215214
await github.rest.issues.create({ ...req, title: 'Link Checker Report', body, labels: ['linkchecker'] })
216215
}
217216
} else {
218217
req.issue_number = issues.data.items[0].number
219218
await github.rest.issues.createComment({ ...req, body })
220-
if (process.env.lychee_exit_code === '0') {
219+
if ('${{ steps.lychee.outputs.exit_code }}' === '0') {
221220
await github.rest.issues.update({ ...req, state: 'closed' })
222221
}
223222
}

0 commit comments

Comments
 (0)