ci: harden Copilot setup workflow#161
Conversation
📝 WalkthroughWalkthroughThe Copilot setup workflow now uses empty top-level permissions with job-scoped read access, runs a hardened runner in audit mode, and installs a pinned mega-linter-runner version. The repository structure documentation updates its workflow inventory by removing sync-labels.yaml and adding the current workflow files. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
@coderabbitai run pre-merge checks The exact PR head is locally validated with actionlint, zizmor, Go build/test/lint, both scaffold helper regressions, and the least-privilege structural assertions. Please evaluate the linked child issue #160 and current two-file diff. |
✅ Actions performedRunning Pre-merge checks. Results will be posted in the summary comment once complete. |
|
ℹ️ Pre-merge checks are not enabled. To use pre-merge checks, please enable them in CodeRabbit settings. |
CodeRabbit confirmed that repository pre-merge checks are disabled, so this draft remains fail-closed despite CLEAN CI and zero review threads. #162 tracks the required dashboard setting. Do not repeat the bot command until that setting changes; once enabled, re-run the supported pre-merge check and require a formal green summary before promotion. |
@coderabbitai review The adaptive review window has reopened. Please review exact head |
|
✅ Action performedReview finished.
|
What changed
contents: readstep-security/harden-runneraction first with audited egressmega-linter-runnerversion and document the narrowly scoped transitive-resolution exceptionsync-labels.yamlentry from theAGENTS.mdworkflow inventoryWhy
The Go template's adopter-facing Copilot setup workflow lagged the least-privilege pattern already used by the .NET template and by this repository's scaffold validation. Closing that parity gap prevents generated projects from inheriting broad workflow permissions or an unhardened setup runner.
The helper still installs globally because Copilot needs the CLI on
PATH; a committed Node lockfile solely for this helper would add disproportionate weight to the minimal Go scaffold. The exact direct version reduces drift, while the inline exception explicitly records the remaining transitive-resolution risk.This is workflow security infrastructure, not a user-facing feature, so feature-flagging is not applicable.
Promotion gate
CI and the current-head review are green, with zero unresolved threads or body findings. Repository pre-merge checks are disabled; #162 tracks the required dashboard setting. Keep this draft fail-closed until that setting is enabled and a supported formal green pre-merge result is posted.
Validation
actionlint .github/workflows/copilot-setup-steps.ymlzizmor .github/workflows/copilot-setup-steps.yml(0 findings; 1 documented exception)go build ./...go test ./...(7 tests across 3 packages)golangci-lint runsh scripts/rename-placeholders.test.shsh .github/scripts/run-mockery.test.shgit diff --checkFixes #160
Part of #104