Skip to content

Avoid unpinned cache action in pre-commit CI - #875

Merged
Sun Haoran (haoranpb) merged 1 commit into
mainfrom
fix/precommit-sha-policy
Sep 14, 2026
Merged

Sun Haoran (haoranpb) merged 1 commit into
mainfrom
fix/precommit-sha-policy

Conversation

@dayland

@dayland dayland commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Why

The repository now requires every external GitHub Action to be pinned to a full commit SHA. Although pre-commit/action itself was pinned, its composite action invokes actions/cache@v4 by a mutable tag, causing both CI lint jobs to fail during workflow preparation.

Run the already-installed repository dependency directly instead of using the wrapper. This preserves the same pre-commit arguments and GitHub annotation behavior without introducing a transitive unpinned action.

Summary

  • Replaced the pre-commit/action wrapper with uv run pre-commit run using the wrapper's existing arguments.
  • Preserved Ruff GitHub annotations through the existing RUFF_OUTPUT_FORMAT environment setting.
  • Removed the transitive actions/cache@v4 reference blocked by repository policy.

Run the repository-managed pre-commit installation directly so CI no longer expands the wrapper's actions/cache@v4 dependency, which violates the full-SHA action policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 08f0eec5-45eb-485a-b89d-d0de33568add

@haoranpb Sun Haoran (haoranpb) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, thanks

@haoranpb
Sun Haoran (haoranpb) merged commit 84b5ba8 into main Sep 14, 2026
14 of 16 checks passed
@haoranpb
Sun Haoran (haoranpb) deleted the fix/precommit-sha-policy branch September 14, 2026 08:04
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.

3 participants