From b3c549629cae3aad49f9977f6717dc850d5ce952 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 10 Oct 2025 08:47:26 +0200 Subject: [PATCH 1/2] Revert "Fix daily link checking (#2339)" This reverts commit bd553854e24fe6aaf69872751b8b55a79680df68. --- .github/workflows/build-daily.yml | 10 +--------- .github/workflows/reusable-link-check.yml | 3 ++- .mise/tasks/lint/links-in-modified-files.sh | 4 ++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-daily.yml b/.github/workflows/build-daily.yml index 8fe632aec..7704cab52 100644 --- a/.github/workflows/build-daily.yml +++ b/.github/workflows/build-daily.yml @@ -16,15 +16,7 @@ jobs: no-build-cache: true link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1 - - - run: mise run lint:links - env: - GITHUB_TOKEN: ${{ github.token }} + uses: ./.github/workflows/reusable-link-check.yml workflow-notification: permissions: diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index 4c31f58fc..efb8e2874 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -17,6 +17,7 @@ jobs: - uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1 - name: Link check - relative links (all files) + if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} run: mise run lint:local-links @@ -24,4 +25,4 @@ jobs: - name: Link check (modified files only) env: GITHUB_TOKEN: ${{ github.token }} - run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} + run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} --event ${{ github.event_name }} diff --git a/.mise/tasks/lint/links-in-modified-files.sh b/.mise/tasks/lint/links-in-modified-files.sh index c3b174ad1..74667f292 100755 --- a/.mise/tasks/lint/links-in-modified-files.sh +++ b/.mise/tasks/lint/links-in-modified-files.sh @@ -5,6 +5,7 @@ set -e #USAGE flag "--base " help="base branch to compare against (default: origin/main)" default="origin/main" #USAGE flag "--head " help="head branch to compare against (empty for local changes) (default: empty)" default="" +#USAGE flag "--event " help="event name (default: pull_request)" default="pull_request" if [ "$usage_head" = "''" ]; then usage_head="" @@ -19,6 +20,9 @@ config_modified=$(git diff --name-only --merge-base "$usage_base" $usage_head \ if [ -n "$config_modified" ] ; then echo "config changes, checking all files." mise run lint:links +elif [ "$usage_event" != "pull_request" ] ; then + echo "Not a PR - skipping link linting." + exit 0 else # Using lychee's default extension filter here to match when it runs against all files # Note: --diff-filter=d filters out deleted files From 42975792c7da678061115715b80a001d3eb64e3f Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 10 Oct 2025 08:51:43 +0200 Subject: [PATCH 2/2] link all links if not PR --- .github/workflows/reusable-link-check.yml | 1 - .mise/tasks/lint/links-in-modified-files.sh | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index efb8e2874..161ae6ade 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -17,7 +17,6 @@ jobs: - uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1 - name: Link check - relative links (all files) - if: github.event_name == 'pull_request' env: GITHUB_TOKEN: ${{ github.token }} run: mise run lint:local-links diff --git a/.mise/tasks/lint/links-in-modified-files.sh b/.mise/tasks/lint/links-in-modified-files.sh index 74667f292..524cc2d28 100755 --- a/.mise/tasks/lint/links-in-modified-files.sh +++ b/.mise/tasks/lint/links-in-modified-files.sh @@ -17,12 +17,12 @@ fi config_modified=$(git diff --name-only --merge-base "$usage_base" $usage_head \ | grep -E '^(\.github/config/lychee\.toml|\.mise/tasks/lint/.*|mise\.toml)$' || true) -if [ -n "$config_modified" ] ; then +if [ "$usage_event" != "pull_request" ] ; then + echo "Not a PR - checking all files." + mise run lint:links +elif [ -n "$config_modified" ] ; then echo "config changes, checking all files." mise run lint:links -elif [ "$usage_event" != "pull_request" ] ; then - echo "Not a PR - skipping link linting." - exit 0 else # Using lychee's default extension filter here to match when it runs against all files # Note: --diff-filter=d filters out deleted files