From a626a94d96326a4c8d16c8f3b66573929418e08c Mon Sep 17 00:00:00 2001 From: pipo02mix Date: Tue, 9 Apr 2024 20:07:58 +0200 Subject: [PATCH] Simplify the checks --- .github/workflows/check-links-in-prod.yaml | 33 ++++++---------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/check-links-in-prod.yaml b/.github/workflows/check-links-in-prod.yaml index d68e8684d5..45b05916f7 100644 --- a/.github/workflows/check-links-in-prod.yaml +++ b/.github/workflows/check-links-in-prod.yaml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 \ No newline at end of file