From c2cc8e09dbd48b71599995834f2dd762c1dbf5f8 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 26 Mar 2025 09:09:03 +1100 Subject: [PATCH] ci: add new link checker workflow for website (#8516) Turns out we have several broken links on our website currently. Broken links don't make a good impression so we should catch them as early as possible. Due to how our website is laid out, that isn't always possible to catch these dead links in CI. The next best thing we can do is run a cron-job in our CI that checks our sourcecode and makes sure all links (including relative ones) are reachable. --------- Signed-off-by: Thomas Eizinger --- .github/workflows/website-links.yml | 34 +++++++++++++++++++++++++++++ website/.lycheeignore | 8 +++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/website-links.yml create mode 100644 website/.lycheeignore diff --git a/.github/workflows/website-links.yml b/.github/workflows/website-links.yml new file mode 100644 index 000000000..b282b40b1 --- /dev/null +++ b/.github/workflows/website-links.yml @@ -0,0 +1,34 @@ +name: Website Links + +on: + repository_dispatch: + workflow_dispatch: + schedule: + - cron: "00 18 * * *" + +defaults: + run: + working-directory: website # Specify working directory to ensure the `.lycheeignore` file is picked up. + +jobs: + linkChecker: + runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file + steps: + - uses: actions/checkout@v4 + + - name: Check links on website + id: lychee + uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 # v2.3.0 + with: + fail: false + args: --verbose --no-progress --exclude-all-private --base https://firezone.dev . + + - name: Create Issue From File + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue diff --git a/website/.lycheeignore b/website/.lycheeignore new file mode 100644 index 000000000..cc4be41df --- /dev/null +++ b/website/.lycheeignore @@ -0,0 +1,8 @@ +# Links included in our website known to not be broken but lychee can't check them :( + +https://www.gartner.com/en/information-technology/glossary/zero-trust-network-access-ztna-/ +https://portal.azure.com +https://x.com/firezonehq +https://admin.google.com/ac/owl +https://www.flexjobs.com/blog/post/exploring-the-impact-of-remote-work-on-mental-health-and-the-workplace/ +.prettierrc.json