Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added broken links check action #1102

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches: [ main, release-* ]
jobs:
malware_security_scan:
name: Malware Scanner
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/broken-links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check Broken Links

on:
push:
branches: [ main ]
pull_request:
branches: [ main, release-* ]
jobs:
check-broken-links:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.120.3'
extended: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Build
run: |
npm install -D --save autoprefixer
npm install -D --save postcss-cli
npm install -D --save postcss
hugo server --bind 127.0.0.1 &
- name: Wait for Hugo server
run: curl --head -X GET --retry 5 --retry-connrefused --retry-delay 10 http://127.0.0.1:1313/csm-docs/
- name: Scanning docs for broken links
continue-on-error: true
run: |
wget --verbose --spider -o spider.log -e robots=off -rp http://127.0.0.1:1313/csm-docs/
- name: Getting output
run: |
sed -n '/broken links/,$p' spider.log
grep -Fxq "Found 0 broken links." spider.log
Loading