@@ -131,13 +131,16 @@ runs:
131131 shell : bash
132132 run : |
133133 echo "result=$(echo "$base_url" |
134- sed 's|^\(.*\)\(/git-scm\.com\)$|(\1)?\2(.*)|') file://$PWD/public\$2" \
134+ sed 's|^\(.*\)\(/git-scm\.com\)$|^ (\1)?\2(.*)|') file://$PWD/public\$2" \
135135 >>$GITHUB_OUTPUT
136136 # When running in forks, do detect when links try to break out of the
137137 # `/git-scm.com/` subdirectory
138138 echo "remap-dotdot=$(echo "$base_url" |
139- sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''(\1.*) file://../$1'\''|p')" \
139+ sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''^ (\1.*) file://../$1'\''|p')" \
140140 >>$GITHUB_OUTPUT
141+ # When running in forks, do treat https://git-scm.com links as if they were relative
142+ test https://git-scm.com = "$base_url" ||
143+ echo "remap-git-scm=--remap '^https?://git-scm.com(.*) file://$PWD/public\$1'" >>$GITHUB_OUTPUT
141144
142145 - name : check for downgrades to unencrypted HTTP
143146 if : startsWith(env.base_url, 'https://')
@@ -163,6 +166,7 @@ runs:
163166 --base '${{ env.base_url }}'
164167 --remap '${{ steps.remap.outputs.result }}'
165168 ${{ steps.remap.outputs.remap-dotdot }}
169+ ${{ steps.remap.outputs.remap-git-scm }}
166170 --exclude file:///path/to/repo.git/
167171 --exclude file:///caminho/para/o/reposit%C3%B3rio.git/
168172 --exclude file:///ruta/a/repositorio.git/
@@ -176,8 +180,7 @@ runs:
176180 fail : false
177181 failIfEmpty : false # needed because its default overrides `fail = false`
178182
179- - name : ${{ env.lychee_exit_code != '0' && 'open or update' || 'maybe close' }} link checker issue
180- if : env.lychee_exit_code != ''
183+ - name : ${{ steps.lychee.outputs.exit_code != '0' && 'open or update' || 'maybe close' }} link checker issue
181184 uses : actions/github-script@v7
182185 with :
183186 github-token : ${{ inputs.github-token }}
@@ -211,13 +214,13 @@ runs:
211214 })()
212215
213216 if (issues.data.items.length === 0) {
214- if (process.env.lychee_exit_code !== '0') {
217+ if ('${{ steps.lychee.outputs.exit_code }}' !== '0') {
215218 await github.rest.issues.create({ ...req, title: 'Link Checker Report', body, labels: ['linkchecker'] })
216219 }
217220 } else {
218221 req.issue_number = issues.data.items[0].number
219222 await github.rest.issues.createComment({ ...req, body })
220- if (process.env.lychee_exit_code === '0') {
223+ if ('${{ steps.lychee.outputs.exit_code }}' === '0') {
221224 await github.rest.issues.update({ ...req, state: 'closed' })
222225 }
223226 }
0 commit comments