Skip to content

Commit

Permalink
build: tune the linkinator workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
  • Loading branch information
yshyn-iohk committed Feb 19, 2025
1 parent 1265cde commit 57a1a25
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,25 @@ jobs:
- name: Get short SHA
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Check links on the live site
- name: Check links on the live site to the action output
run: |
echo "Commit SHA: $SHORT_SHA"
npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json --format text
npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json > link-check-results.json
npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json --format text || true
echo "LINKINATOR_EXIT_CODE=$?" >> $GITHUB_ENV
- name: Check links on the live site and safe to a file
if: env.LINKINATOR_EXIT_CODE != 0
run: |
npx linkinator https://hyperledger-identus.github.io/docs/ --config .linkinatorrc.json > link-check-results.txt || true
- name: Upload Linkinator output
uses: actions/upload-artifact@v4
with:
name: linkinator-results-${{ env.SHORT_SHA }}
path: link-check-results.txt
path: link-check-results.txt

- name: Faile the build if there are broken links
if: env.LINKINATOR_EXIT_CODE != 0
run: |
echo "Broken links detected. Check the artifact for details."
exit 1

0 comments on commit 57a1a25

Please sign in to comment.