Skip to content

Commit

Permalink
Simplify the checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pipo02mix committed Apr 9, 2024
1 parent d9914ee commit a626a94
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions .github/workflows/check-links-in-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/overview/ \
--check-extern \
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_OUTPUT"
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: check-links-in-getting-started-pages
Expand All @@ -27,7 +27,7 @@ jobs:
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/getting-started/ \
--check-extern \
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_OUTPUT"
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: check-links-in-tutorials-pages
Expand All @@ -36,7 +36,7 @@ jobs:
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/tutorials/ \
--check-extern \
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_OUTPUT"
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: check-links-in-reference-pages
Expand All @@ -45,7 +45,7 @@ jobs:
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/reference/ \
--check-extern \
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_OUTPUT"
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: check-links-in-support-pages
Expand All @@ -54,7 +54,7 @@ jobs:
ghcr.io/linkchecker/linkchecker:latest \
https://docs.giantswarm.io/support/ \
--check-extern \
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_OUTPUT"
-t 1 -r 2 || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: check-links-in-changelogs
Expand All @@ -67,29 +67,12 @@ jobs:
--ignore-url="^https://.*example\.com/.*" \
--ignore-url="^https://my-org\.github\.com/.*" \
--ignore-url="^https://github\.com/giantswarm/giantswarm/.*" \
--ignore-url=".*gigantic\.io.*" || echo "failed=true" >> "$GITHUB_OUTPUT"
--ignore-url=".*gigantic\.io.*" || echo "failed=true" >> "$GITHUB_ENV"
continue-on-error: true

- name: Report errors
run: |
if [[ "${{ steps.check-links-in-overview-pages.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in overview checks"
fi
if [[ "${{ steps.check-links-in-getting-started-pages.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in getting started checks"
fi
if [[ "${{ steps.check-links-in-tutorials-pages.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in tutorials checks"
fi
if [[ "${{ steps.check-links-in-reference-pages.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in reference checks"
fi
if [[ "${{ steps.check-links-in-support-pages.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in support checks"
fi
if [[ "${{ steps.check-links-in-changelogs.outputs.failed }}" == "true" ]]; then
echo "There has been some errors in changelogs checks"
fi
if [[ "${{ steps.check-links-in-overview-pages.outputs.failed }}" == "true" ]] || [[ "${{ steps.check-links-in-getting-started-pages.outputs.failed }}" == "true" ]] || [[ "${{ steps.check-links-in-tutorials-pages.outputs.failed }}" == "true" ]] || [[ "${{ steps.check-links-in-reference-pages.outputs.failed }}" == "true" ]] || [[ "${{ steps.check-links-in-support-pages.outputs.failed }}" == "true" ]] || [[ "${{ steps.check-links-in-changelogs.outputs.failed }}" == "true" ]]; then
if [[ $failed == "true" ]]; then
echo "There has been some errors in the previous checks, take a look at the logs."
exit 1
fi

0 comments on commit a626a94

Please sign in to comment.