Skip to content

ci: add permissions and pin actions to full commit SHAs - #1270

Open
XananasX7 wants to merge 1 commit into
madler:masterfrom
XananasX7:ci/pin-actions
Open

ci: add permissions and pin actions to full commit SHAs#1270
XananasX7 wants to merge 1 commit into
madler:masterfrom
XananasX7:ci/pin-actions

Conversation

@XananasX7

Copy link
Copy Markdown

All 6 non-fuzz workflow files were missing a top-level permissions: block and used mutable tag references (@v6, @master, @v1, etc.).

Add permissions: contents: read to each workflow (principle of least privilege).

Pin all uses: to full commit SHAs (tags kept as comments):

Action Before After
actions/checkout @v6 / @v4 @df4cb1c0 / @34e11487
actions/upload-artifact @v6 @b7c566a7
msys2/setup-msys2 @v2 @66cd2cce
cygwin/cygwin-install-action @master @781ea34f
vmactions/dragonflybsd-vm @v1 @4ba8127b
vmactions/freebsd-vm @v1 @a6de9343
vmactions/netbsd-vm @v1 @99816dcc
vmactions/omnios-vm @v1 @7f2be0b9
vmactions/openbsd-vm @v1 @fcf799d7
vmactions/solaris-vm @v1 @d30dd6c2

Qualifies under the Google Open Source Patch Rewards Program.

All 6 non-fuzz workflow files were missing a top-level permissions
block and used mutable tag references. Add permissions: contents: read
and pin every uses: to its full commit SHA (tag kept as comment):

  actions/checkout: @v6 -> @df4cb1c069e1874edd31b4311f1884172cec0e10
  actions/checkout: @v4 -> @34e114876b0b11c390a56381ad16ebd13914f8d5
  actions/upload-artifact: @v6 -> @b7c566a772e6b6bfb58ed0dc250532a479d7789f
  msys2/setup-msys2: @v2 -> @66cd2cce69caa17b53920067426061ca1de3a884
  cygwin/cygwin-install-action: @master -> @781ea34f8c7c28e794b807fb7120e93bfdac3089
  vmactions/dragonflybsd-vm: @v1 -> @4ba8127bd95c94b66fc4b885e37c99955ba308ea
  vmactions/freebsd-vm: @v1 -> @a6de9343ef5747433d9c25784c90e84998b9d69a
  vmactions/netbsd-vm: @v1 -> @99816dccf75edf233ed6cd00a159e3a5b85ea373
  vmactions/omnios-vm: @v1 -> @7f2be0b927aad1a78498c8aeeac4c4ce1fabd322
  vmactions/openbsd-vm: @v1 -> @fcf799d7ce9c305ad89eabef1fb2fa5c1c42d0ee
  vmactions/solaris-vm: @v1 -> @d30dd6c228c8661ade859e36ead7660b9a62efcc
@mtl1979

mtl1979 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adding more restrictive permissions to CI workflows and pinning to commit SHAs should be separate PRs as pinning to commit SHAs is discouraged by project maintainers as already pointed out in other similar PRs that were recently created.

There are several issues with pinning workflow actions to commit SHAs due to how the CI runners are updated. One of them is that essentially each runner has minimum version requirements that can't be satisfied if the actions are pinned to commit SHAs and will eventually break the CI runs causing unnecessary maintainability burden.

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.

2 participants