Skip to content

chore(ci): pin third-party actions to commit SHA#13

Merged
trisdoan merged 1 commit into
mainfrom
fix/sha-pin-third-party-actions
May 13, 2026
Merged

chore(ci): pin third-party actions to commit SHA#13
trisdoan merged 1 commit into
mainfrom
fix/sha-pin-third-party-actions

Conversation

@xaviedoanhduy
Copy link
Copy Markdown
Member

@xaviedoanhduy xaviedoanhduy commented May 13, 2026

Why

External GitHub Actions have mutable tags — an attacker (or compromised maintainer)
can re-point a tag like @v5 to malicious code. Pinning to a full commit SHA gives
us an immutable reference. This is GitHub's recommended security practice:
https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions

This matches the convention already in trobz/odoo-modules (regenerate-pages.yml).

What

  • astral-sh/setup-uv: upgrade v5 → v8.1.0 and pin to commit SHA.
    The setup-uv README uses SHA-pinned format in all examples.
  • python-semantic-release/python-semantic-release: bump v10.5.2 → v10.5.3 and pin to commit SHA.

GitHub-owned actions/* (checkout, cache) kept on version tags — pragmatic stance,
matches odoo-modules/regenerate-pages.yml. Upstream actions/* docs don't advocate SHA pinning.

Test plan

  • PR trigger fires pre-commit.yaml — verify green with setup-uv v8
  • On merge, release.yaml runs python-semantic-release v10.5.3 SHA
  • No regression in cache behavior (enable-cache: true)

Related: trobz/minisite-internal#11 (blog post recommending this pattern).

@xaviedoanhduy xaviedoanhduy force-pushed the fix/sha-pin-third-party-actions branch from 2a0f89a to 3a81145 Compare May 13, 2026 04:14
@xaviedoanhduy xaviedoanhduy changed the title chore(ci): pin third-party actions to commit SHA chore(ci): pin third-party actions to commit SHA / latest tag May 13, 2026
@nilshamerlinck
Copy link
Copy Markdown
Contributor

SHA pinning not advocated by maintainers.

but any reason not to do it?

- astral-sh/setup-uv: upgrade v5 → v8.1.0, pin to commit SHA.
  The setup-uv README demonstrates SHA-pinned usage in all examples.
- python-semantic-release: bump v10.5.2 → v10.5.3, pin to commit SHA.

GitHub-owned actions/* (checkout, cache) kept on version tags —
pragmatic stance matching trobz/odoo-modules convention.

Ref: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions
@xaviedoanhduy xaviedoanhduy force-pushed the fix/sha-pin-third-party-actions branch from 3a81145 to 30f9c97 Compare May 13, 2026 08:20
@xaviedoanhduy xaviedoanhduy changed the title chore(ci): pin third-party actions to commit SHA / latest tag chore(ci): pin third-party actions to commit SHA May 13, 2026
@xaviedoanhduy
Copy link
Copy Markdown
Member Author

SHA pinning not advocated by maintainers.

but any reason not to do it?

fair point — no strong reason not to.
updated to SHA pin: python-semantic-release/python-semantic-release@ # v10.5.3

@trisdoan trisdoan merged commit c5feef6 into main May 13, 2026
1 check passed
@trisdoan
Copy link
Copy Markdown
Collaborator

@xaviedoanhduy Need to impact /template/{% if enable_github_action %}.github{% endif%} correct ?

@xaviedoanhduy
Copy link
Copy Markdown
Member Author

@xaviedoanhduy Need to impact /template/{% if enable_github_action %}.github{% endif%} correct ?

good catch, thanks

followup in: #14

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