Skip to content

Add reusable checks.yml (pre-commit, zizmor, lychee)#625

Draft
bschwedler wants to merge 10 commits into
mainfrom
worktree-lychee-link-checking
Draft

Add reusable checks.yml (pre-commit, zizmor, lychee)#625
bschwedler wants to merge 10 commits into
mainfrom
worktree-lychee-link-checking

Conversation

@bschwedler

Copy link
Copy Markdown
Contributor

Extracts the inline lint and zizmor jobs from ci.yml into a new
reusable checks.yml workflow, adds lychee link checking, and wires
ci.yml up as the first caller.

Sibling repos can adopt checks.yml to get pre-commit, zizmor, and
link checking without duplicating the job definitions.

What changed

  • checks.yml — new reusable workflow with three independently
    toggleable jobs: pre-commit, zizmor, lychee. All inputs follow
    the {tool}-{option} naming convention (lychee-args, lychee-run,
    zizmor-advanced-security, zizmor-run, pre-commit-run,
    python-version, python-version-file).
  • ci.yml — replaces the inline lint + zizmor jobs with a single
    checks caller.
  • .lycheeignore — excludes rate-limited, auth-gated, and private hosts
    from link checks.
  • justfile — adds a check-links recipe for local use.

Notes

  • pre-commit/action is replaced with a direct uvx pre-commit invocation.
    The composite action internally uses actions/cache@v4 (floating tag),
    which fails the org's transitive SHA-pin policy.
  • zizmor-advanced-security defaults to true. Repos without GitHub
    Advanced Security should set it to false and omit
    security-events: write from their caller permissions.
  • Lychee runs only on pull_request and merge_group events (same as
    pre-commit). Link checks on push-to-main would be redundant.

The shared lychee default now globs **/*.*md, which matches both
Markdown and Quarto (.qmd) files, so any repo's docs are covered.

images-shared is currently the only repo with .qmd files. Its CI
caller excludes the presentations/ directory, which holds dated slide
decks rather than maintained docs. The dl.posit.co bare directory
path, which 404s with no served index, is added to .lycheeignore.
Allows callers without GitHub Advanced Security to set
zizmor-advanced-security: false and skip the SARIF upload step,
removing the security-events: write requirement for those repos.
Aligns with the lychee-args / zizmor-advanced-security convention
so all inputs follow the {tool}-{option} pattern and group together
alphabetically.
lychee-*, pre-commit-* (including python-*), zizmor-*
pre-commit/action is a composite action that internally uses
actions/cache@v4 (a floating tag), which fails the org's
transitive SHA-pin policy even though the action itself is pinned.

Replace it with a self-controlled cache step (SHA-pinned v5.0.5,
matching the lychee cache step) and a direct pip install + run.
Drops the explicit pip install in favour of uvx, which downloads
and runs the tool ephemerally. Consistent with how the rest of the
project uses uv.
@github-actions

Copy link
Copy Markdown

Test Results

1 896 tests   1 896 ✅  7m 34s ⏱️
    1 suites      0 💤
    1 files        0 ❌

Results for commit 19ca4f4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant