Skip to content

Commit

Permalink
Use action to check links
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Jan 9, 2024
1 parent e5682ce commit 7096bb0
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/reusable-published-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,26 @@ jobs:
with:
node-version: '16'

- name: Install link checker
run: npm install github:recrwplay/link-checker#v0.2.0
# - name: Install link checker
# run: npm install github:recrwplay/link-checker#v0.2.0

- name: Run link checker
run: |
npx link-checker $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e |& tee link-log.txt
warncount=$(grep -e "[0-9]* warnings" -o link-log.txt | sed 's/ warnings//' )
if [ $warncount -gt 0 ]; then
echo "::warning:: $warncount warnings"
fi
errorcount=$(grep -e "[0-9]* errors" -o link-log.txt | sed 's/ errors//' )
if [ $errorcount -gt 0 ]; then
echo "::error:: Errors found: See the output of the Check links step for details"
exit 1
fi
uses: filiph/[email protected]
with:
arguments: $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e

# - name: Run link checker
# run: |
# npx link-checker $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e |& tee link-log.txt
# warncount=$(grep -e "[0-9]* warnings" -o link-log.txt | sed 's/ warnings//' )
# if [ $warncount -gt 0 ]; then
# echo "::warning:: $warncount warnings"
# fi
# errorcount=$(grep -e "[0-9]* errors" -o link-log.txt | sed 's/ errors//' )
# if [ $errorcount -gt 0 ]; then
# echo "::error:: Errors found: See the output of the Check links step for details"
# exit 1
# fi

# upload artifacts

Expand Down

0 comments on commit 7096bb0

Please sign in to comment.