File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 3333 docs
3434 env :
3535 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36+ - name : Prepare broken link report
37+ id : lychee_report
38+ if : ${{ steps.lychee.outputs.exit_code && steps.lychee.outputs.exit_code != '0' }}
39+ shell : bash
40+ run : |
41+ report_file="lychee/out.md"
42+ if [[ ! -s "$report_file" ]]; then
43+ echo "report<<EOF" >> "$GITHUB_OUTPUT"
44+ echo "Lychee detected broken links, but the report file (\`$report_file\`) was empty or missing." >> "$GITHUB_OUTPUT"
45+ echo "EOF" >> "$GITHUB_OUTPUT"
46+ exit 0
47+ fi
48+
49+ echo "report<<EOF" >> "$GITHUB_OUTPUT"
50+ cat "$report_file" >> "$GITHUB_OUTPUT"
51+ echo "EOF" >> "$GITHUB_OUTPUT"
3652 - name : Comment on PR if broken links found
3753 if : ${{ steps.lychee.outputs.exit_code && steps.lychee.outputs.exit_code != '0' }}
3854 uses : thollander/actions-comment-pull-request@v3
4258 <details>
4359 <summary>Click to expand</summary>
4460
45- ```markdown
46- ${{ steps.lychee.outputs.report }}
47- ```
61+ ${{ steps.lychee_report.outputs.report }}
4862 </details>
4963 env :
5064 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments