@@ -131,13 +131,16 @@ runs:
131
131
shell : bash
132
132
run : |
133
133
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" \
135
135
>>$GITHUB_OUTPUT
136
136
# When running in forks, do detect when links try to break out of the
137
137
# `/git-scm.com/` subdirectory
138
138
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')" \
140
140
>>$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
141
144
142
145
- name : check for downgrades to unencrypted HTTP
143
146
if : startsWith(env.base_url, 'https://')
@@ -163,6 +166,7 @@ runs:
163
166
--base '${{ env.base_url }}'
164
167
--remap '${{ steps.remap.outputs.result }}'
165
168
${{ steps.remap.outputs.remap-dotdot }}
169
+ ${{ steps.remap.outputs.remap-git-scm }}
166
170
--exclude file:///path/to/repo.git/
167
171
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
168
172
--exclude file:///ruta/a/repositorio.git/
@@ -176,8 +180,7 @@ runs:
176
180
fail : false
177
181
failIfEmpty : false # needed because its default overrides `fail = false`
178
182
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
181
184
uses : actions/github-script@v7
182
185
with :
183
186
github-token : ${{ inputs.github-token }}
@@ -211,13 +214,13 @@ runs:
211
214
})()
212
215
213
216
if (issues.data.items.length === 0) {
214
- if (process.env.lychee_exit_code !== '0') {
217
+ if ('${{ steps.lychee.outputs.exit_code }}' !== '0') {
215
218
await github.rest.issues.create({ ...req, title: 'Link Checker Report', body, labels: ['linkchecker'] })
216
219
}
217
220
} else {
218
221
req.issue_number = issues.data.items[0].number
219
222
await github.rest.issues.createComment({ ...req, body })
220
- if (process.env.lychee_exit_code === '0') {
223
+ if ('${{ steps.lychee.outputs.exit_code }}' === '0') {
221
224
await github.rest.issues.update({ ...req, state: 'closed' })
222
225
}
223
226
}
0 commit comments