Skip to content

Scope the workflow token, pin the actions, move off the retired runner - #308

Merged
nohwnd merged 1 commit into
mainfrom
ci/harden-workflow
Sep 5, 2026
Merged

nohwnd merged 1 commit into
mainfrom
ci/harden-workflow

Conversation

@nohwnd

@nohwnd nohwnd commented Sep 5, 2026

Copy link
Copy Markdown
Member

Three things, from an Actions security pass across the pester org.

The token. ci.yml declared no permissions block at all, so the job ran on the repository default, which was a token with write access to everything - contents, packages, deployments, issues, security events. It is scoped now to what release-drafter needs:

permissions:
  contents: write      # create the draft release
  pull-requests: read  # read merged PRs to build the notes

pull-requests: write is only needed for release-drafter's autolabeler, which is not used here. If drafting turns out to need it, that is the one line to change.

Pinning. All nine action references now point at commit SHAs, so a moved tag cannot change what runs. Dependabot is already configured in this repo and keeps the SHA and the trailing version comment in sync, so this does not become manual work.

The runner. ubuntu-20.04 was retired by GitHub, and the Build runs have not been completing since. This moves to ubuntu-latest. That is the risky half of this change - if the build does not like the newer image, this pull request's own CI run is where it shows up. The other two changes are safe regardless.

Once this merges, the repository default workflow token can go to read-only, which is already done for every other repo in the org.

🤖

ci.yml declared no permissions, so the job ran on the repository default, which was
a token with write access to everything. It is scoped to what release-drafter
actually needs now: create the draft release, read merged pull requests for the
notes.

All nine action references are pinned to commit SHAs, so a moved tag cannot change
what runs. Dependabot is already configured here and keeps the SHA and the trailing
version comment in sync.

ubuntu-20.04 was retired by GitHub and the Build runs have not been completing since.
This moves to ubuntu-latest, which is the part that needs the CI run on this pull
request to prove.

🤖
@nohwnd
nohwnd merged commit 11d6a9b into main Sep 5, 2026
3 checks passed
@nohwnd
nohwnd deleted the ci/harden-workflow branch September 5, 2026 11:47
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