Skip to content

ci: gate deploy on lint and scope workflow permissions - #55

Merged
megabyde merged 1 commit into
mainfrom
ci/deploy-gating
Aug 16, 2026
Merged

ci: gate deploy on lint and scope workflow permissions#55
megabyde merged 1 commit into
mainfrom
ci/deploy-gating

Conversation

@megabyde

@megabyde megabyde commented Aug 16, 2026

Copy link
Copy Markdown
Member

Second of three stacked PRs, replacing #53. Based on #54; merge that first and GitHub will retarget this to main. #56 sits on top of this one. The diff shown here is this commit alone.

Permissions

The workflow held contents: read, pages: write, and id-token: write at the top level, granting every job the deployment credentials. Now permissions: {} at the top with per-job grants, so only deploy can write to Pages and mint an OIDC token.

Deploy gating

build now declares needs: lint. Previously lint and build ran in parallel and deploy waited only on build, so a failing make check on a push to main still published. Branch protection would have covered the pull request path but not direct pushes.

deploy gets a pages concurrency group with cancel-in-progress: false, so overlapping pushes to main cannot race the deployment. The group is job-level rather than workflow-level deliberately: this workflow also runs lint and build on pull requests, and a workflow-level group would queue those against deployments.

Dependencies

npm ci --ignore-scripts replaces npm install --ignore-scripts --no-package-lock. Without a lockfile, transitive dependencies floated between runs, Dependabot could not see them for advisories, and setup-node's built-in cache could not be enabled. cache: npm is now on.

actions/configure-pages is removed: nothing consumed its outputs, and page_url comes from deploy-pages itself.

Ownership and updates

Adds CODEOWNERS and a monthly Dependabot schedule for npm and github-actions.

Not included

Actions stay pinned to tags rather than commit SHAs. That is a stricter policy worth discussing on its own rather than folding in here.

Drop the blanket workflow permissions in favour of per-job grants, so only
the deploy job holds `pages: write` and `id-token: write`.

Run `make check` as a job that build depends on, so a lint failure stops
the deployment on pushes to main and not only on pull requests. Serialize
the deploy job on a `pages` concurrency group to stop overlapping pushes
racing each other.

Add CODEOWNERS and a monthly Dependabot schedule for npm and actions.
@megabyde
megabyde merged commit b3494d4 into main Aug 16, 2026
3 checks passed
@megabyde
megabyde deleted the ci/deploy-gating branch August 16, 2026 05:57
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