1
0
mirror of synced 2026-01-03 06:04:16 -05:00

New broken link report (#16412)

* add linkinator npm package

* add new script that uses Linkinator

* reorg the excluded links file and update comments

* replace blc artifacts with linkinator artifacts in .gitignore

* update the scheduled workflow to use the new script

* dismantle BLC scripts

* add workflow_dispatch event so we can test this manually

* npm uninstall broken-link-checker

* use different exit codes depending on whether broken links are found
This commit is contained in:
Sarah Schneider
2020-11-10 15:28:44 -05:00
committed by GitHub
parent fa649bf494
commit ce33df1cd3
9 changed files with 471 additions and 1007 deletions

View File

@@ -1,6 +1,7 @@
name: Check all English links
on:
workflow_dispatch:
schedule:
- cron: "40 19 * * *" # once a day at 19:40 UTC / 11:40 PST
@@ -10,21 +11,16 @@ jobs:
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- name: Run script
run: script/check-external-links en > broken_links.md
run: script/check-english-links > broken_links.md
- name: Check if any broken links
id: check
run: |
if [ "$(grep 'All links are good' broken_links.md)" ]; then
if [ "$(grep '0 broken links found' broken_links.md)" ]; then
echo ::set-output name=continue::no
else
echo "::set-output name=continue::yes"
echo "::set-output name=title::$(grep 'found on help.github.com' broken_links.md)"
echo "::set-output name=title::$(head -1 broken_links.md)"
fi
- if: ${{ steps.check.outputs.continue == 'yes' }}
name: Create issue from file