From a01920b0c06ab4b544f7be06e757c868b777be92 Mon Sep 17 00:00:00 2001 From: Eddie Rowe <74205376+eddie-rowe@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:13:14 -0600 Subject: [PATCH] Create a weekly 404 checker for all Consul docs content (#16603) --- .github/workflows/broken-link-check.yml | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/broken-link-check.yml diff --git a/.github/workflows/broken-link-check.yml b/.github/workflows/broken-link-check.yml new file mode 100644 index 0000000000..8e865a485f --- /dev/null +++ b/.github/workflows/broken-link-check.yml @@ -0,0 +1,30 @@ +name: Broken Link Check + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Run lychee link checker + id: lychee + uses: lycheeverse/lychee-action@v1.6.1 + with: + args: ./docs --base https://developer.hashicorp.com/ --exclude-all-private --exclude .png --exclude .svg --max-concurrency=24 --no-progress --verbose + # Fail GitHub action when broken links are found? + fail: false + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Create GitHub Issue From lychee output file + if: env.lychee_exit_code != 0 + uses: peter-evans/create-issue-from-file@v4 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue \ No newline at end of file