diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index a07e6e0..e851ac5 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -121,21 +121,22 @@ jobs: container: image: git.fabledsword.com/bvandeusen/ci-python:3.14 steps: + # Bare `uses:`, no `with:` block. Adding one made this action fail to + # extract on the act_runner ("Cannot find module .../dist/index.js") while + # every bare checkout in the same run succeeded — see run 3027. Nothing + # here needs `fetch-depth: 0` anyway: the version check diffs two trees, + # and a tree diff needs both trees, not a common ancestor. A depth-1 fetch + # of main's tip is enough, and cheaper. - uses: actions/checkout@v6 - with: - # The version-bump check diffs shipped plugin content against - # origin/main, so it needs history — a shallow clone can't resolve it - # and the check would fail loudly rather than pass blind. - fetch-depth: 0 - # On main the comparison is against itself, so only the syntax and - # pattern checks are meaningful there. + # On main the comparison would be against itself, so only the syntax and + # pattern checks mean anything there. - name: Check plugin hooks and manifest run: | if [ "${{ github.ref }}" = "refs/heads/main" ]; then python3 scripts/check_plugin.py --no-version else - git fetch --no-tags origin main:refs/remotes/origin/main + git fetch --no-tags --depth=1 origin main:refs/remotes/origin/main python3 scripts/check_plugin.py fi diff --git a/scripts/check_plugin.py b/scripts/check_plugin.py index f535c36..c67c92f 100755 --- a/scripts/check_plugin.py +++ b/scripts/check_plugin.py @@ -171,8 +171,9 @@ def check_version_bump(base: str = "origin/main") -> None: # of bug survives in the first place. fail( f"cannot resolve {base}, so the version-bump check could not run. " - f"Fetch it (checkout needs fetch-depth: 0) or pass --no-version " - f"deliberately." + f"Fetch it first — `git fetch --depth=1 origin main:refs/remotes/" + f"origin/main` is enough, since this diffs two trees and needs no " + f"common ancestor — or pass --no-version deliberately." ) return