From 7e7a5f8e7adcf9f110c0b9fe262f8750710f3b61 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Mon, 22 Aug 2022 16:12:58 -0400 Subject: [PATCH] Error on broken links --- .github/workflows/cd.yml | 8 ++++++++ .github/workflows/staging.yml | 8 ++++++++ lychee.toml | 13 +++++++++++++ src/layouts/_default/baseof.html | 1 - src/layouts/partials/footer.html | 2 -- src/layouts/partials/scriptFooter.html | 1 - 6 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 lychee.toml delete mode 100644 src/layouts/partials/scriptFooter.html diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 00a9a7f..23070e0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,6 +30,14 @@ jobs: with: target: build + - name: Check for broken links + uses: lycheeverse/lychee-action@v1 + with: + fail: true + args: --verbose --no-progress './public/**/*.md' './public/**/*.html' + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + ## means s3 sync will only sync things we need sync’d - uses: chetan/git-restore-mtime-action@v1 diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 9646eaa..0ea83ab 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -38,6 +38,14 @@ jobs: with: target: build + - name: Check for broken links + uses: lycheeverse/lychee-action@v1 + with: + fail: true + args: --verbose --no-progress './public/**/*.md' './public/**/*.html' + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - uses: actions/setup-node@v3 with: node-version: 14 diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..3ebe568 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,13 @@ +verbose = true +no-progress = true +scheme = [] +base = "./public" +exclude-mail = true +include = ["./public/**/*.md", "./public/**/*.html"] +exclude = [ + "https://fonts.gstatic.com/", + "https://fonts.googleapis.com/", + "https://www.clarity.ms/tag/", + "https://www.googletagmanager.com/gtm.js", + ".*/mailto:.*@.*", +] diff --git a/src/layouts/_default/baseof.html b/src/layouts/_default/baseof.html index 24bf824..1617ebb 100644 --- a/src/layouts/_default/baseof.html +++ b/src/layouts/_default/baseof.html @@ -21,7 +21,6 @@ - {{- partial "scriptFooter.html" . -}} \ No newline at end of file diff --git a/src/layouts/partials/footer.html b/src/layouts/partials/footer.html index 214f739..721f86b 100644 --- a/src/layouts/partials/footer.html +++ b/src/layouts/partials/footer.html @@ -88,8 +88,6 @@ - - \ No newline at end of file