diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 006bcce44..3462b2470 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,12 +36,13 @@ jobs: key: ${{ runner.os }}-${{ env.MDBOOK_VERSION }}--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ env.MDBOOK_TOC_VERSION }}--${{ env.MDBOOK_MERMAID_VERSION }} - name: Restore cached Linkcheck - if: github.event_name == 'schedule' id: cache-linkcheck-restore uses: actions/cache/restore@v4 with: path: book/linkcheck/cache.json - key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }} + key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }} + restore-keys: | + linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}-- - name: Install latest nightly Rust toolchain if: steps.mdbook-cache.outputs.cache-hit != 'true' @@ -62,11 +63,11 @@ jobs: - name: Save cached Linkcheck id: cache-linkcheck-save - if: ${{ !cancelled() && github.event_name == 'schedule' }} + if: ${{ !cancelled() }} uses: actions/cache/save@v4 with: path: book/linkcheck/cache.json - key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }} + key: linkcheck--${{ env.MDBOOK_LINKCHECK2_VERSION }}--${{ github.run_id }} - name: Deploy to gh-pages if: github.event_name == 'push' diff --git a/ci/linkcheck.sh b/ci/linkcheck.sh index e5184839b..cde4549c2 100755 --- a/ci/linkcheck.sh +++ b/ci/linkcheck.sh @@ -15,7 +15,7 @@ if [ -z "$ENABLE_LINKCHECK" ] ; then fi # https://docs.github.com/en/actions/reference/environment-variables -if [ "$GITHUB_EVENT_NAME" = "schedule" ] ; then # running in scheduled job +if [ "$GITHUB_EVENT_NAME" = "pull_request" ] ; then # running in scheduled job FLAGS="" USE_TOKEN=1