Skip to content

Commit 9793a81

Browse files
heiskrCopilot
andauthored
Fix external link checker alert and wrong pat name (#59386)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: heiskr <1221423+heiskr@users.noreply.github.com>
1 parent 1a4f0ec commit 9793a81

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.github/workflows/link-check-external.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,30 @@ jobs:
4242
fi
4343
4444
- name: Upload report artifact
45-
if: failure()
45+
if: always()
4646
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4747
with:
4848
name: external-link-report
4949
path: artifacts/external-link-report.*
5050
retention-days: 14
51+
if-no-files-found: ignore
52+
53+
- name: Check if report exists
54+
if: always()
55+
id: check_report
56+
run: |
57+
if [ -f "artifacts/external-link-report.md" ]; then
58+
echo "has_report=true" >> $GITHUB_OUTPUT
59+
else
60+
echo "has_report=false" >> $GITHUB_OUTPUT
61+
echo "No broken link report generated - all links valid!"
62+
fi
5163
5264
- name: Create issue if broken links found
53-
if: failure()
65+
if: always() && steps.check_report.outputs.has_report == 'true'
5466
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
5567
with:
56-
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
68+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
5769
repository: github/docs-content
5870
title: '🌐 Broken External Links Report'
5971
content-filepath: artifacts/external-link-report.md

.github/workflows/link-check-internal.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
if: matrix.language != 'en'
7979
uses: ./.github/actions/clone-translations
8080
with:
81-
token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }}
81+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
8282

8383
- name: Check internal links
8484
env:
@@ -125,14 +125,14 @@ jobs:
125125
# Check if any reports exist
126126
if ls reports/*.md 1> /dev/null 2>&1; then
127127
echo "has_reports=true" >> $GITHUB_OUTPUT
128-
128+
129129
# Combine all markdown reports
130130
echo "# Internal Links Report" > combined-report.md
131131
echo "" >> combined-report.md
132132
echo "Generated: $(date -u +'%Y-%m-%d %H:%M UTC')" >> combined-report.md
133133
echo "[Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> combined-report.md
134134
echo "" >> combined-report.md
135-
135+
136136
for report in reports/*.md; do
137137
echo "---" >> combined-report.md
138138
cat "$report" >> combined-report.md
@@ -147,7 +147,7 @@ jobs:
147147
if: steps.combine.outputs.has_reports == 'true'
148148
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
149149
with:
150-
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
150+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
151151
repository: github/docs-content
152152
title: '🔗 Broken Internal Links Report'
153153
content-filepath: combined-report.md

src/links/scripts/check-links-external.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ async function main() {
356356

357357
console.log(`Created report issue: ${newReport.html_url}`)
358358
}
359-
360-
// Exit with error if broken links found
361-
process.exit(1)
362359
}
363360

364361
// Run if invoked directly

0 commit comments

Comments
 (0)