From dfa442dfd13cc039d3b87c8767848db84a4e35c7 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Mon, 30 Sep 2024 10:56:35 +0200 Subject: [PATCH 1/2] use lychee cache --- .github/workflows/links-fail-fast.yml | 8 ++++++++ .github/workflows/links.yml | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index a7cc09227d1..28b3f070258 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -10,7 +10,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Restore lychee cache + uses: actions/cache@v4 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker uses: lycheeverse/lychee-action@v1.10.0 with: fail: true + args: --max-concurrency 5 --cache --max-cache-age 1d . diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 800bc2048f0..9a6096d1648 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -14,9 +14,19 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 + + - name: Restore lychee cache + uses: actions/cache@v4 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v1.10.0 + with: + args: --max-concurrency 1 --cache --max-cache-age 1d . - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 From d40c2536f3934337ba675fc76909a592644c81dd Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Wed, 2 Oct 2024 10:43:49 +0200 Subject: [PATCH 2/2] use a custom github token to authenticate requests --- .github/workflows/links-fail-fast.yml | 4 ++++ .github/workflows/links.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/links-fail-fast.yml b/.github/workflows/links-fail-fast.yml index 28b3f070258..0b7e23e43f5 100644 --- a/.github/workflows/links-fail-fast.yml +++ b/.github/workflows/links-fail-fast.yml @@ -7,6 +7,8 @@ on: jobs: check-links: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v4 @@ -19,6 +21,8 @@ jobs: - name: Link Checker uses: lycheeverse/lychee-action@v1.10.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: fail: true args: --max-concurrency 5 --cache --max-cache-age 1d . diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 9a6096d1648..19a7368d900 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -10,6 +10,8 @@ on: jobs: check-links: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -25,6 +27,8 @@ jobs: - name: Link Checker id: lychee uses: lycheeverse/lychee-action@v1.10.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: --max-concurrency 1 --cache --max-cache-age 1d .