Repository navigation
ci: harden GitHub Actions workflows and resolve code-scanning alerts - #284
Merged
Merged
Conversation
## What/Why Apply least-privilege permissions, harden-runner egress auditing, and PR concurrency across all workflows, and rename them to .yaml, to meet the repo's GitHub Actions standards and clear open code-scanning alerts. ## Proof it works actionlint clean, golangci-lint run 0 issues, make test passes. Renames preserve every job id and name:, so the six required status checks keep matching. ## Risk + AI role Low -- workflow config only, no application code. AI-generated (Claude Opus 4.8) with human review of each permission scope and concurrency decision. ## Review focus - post-merge.yaml contents: write scope for the BYOB badge action -- confirm it is actually required. - Concurrency on pull_request_target workflows and the intentional omission on release.yaml. Resolves code-scanning alerts #169, #178 (missing workflow permissions on ci) and #179 (unsanitized github.base_ref). Signed-off-by: jmeridth <jmeridth@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub Actions workflows by applying least-privilege permissions, adding runner egress auditing, introducing concurrency controls (where appropriate), and renaming workflows from .yml to .yaml to align with repository standards and address code-scanning findings.
Changes:
- Apply default-deny workflow permissions (
permissions: {}) and set job-scoped permissions per workflow needs. - Add
step-security/harden-runnerwithegress-policy: auditand add PR concurrency to reduce redundant CI runs. - Rename
pr-titleworkflow from.ymlto.yaml, preserving job IDs/names for required checks.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .gitignore | Ignore .worktrees/ directory for local git worktree usage. |
| .github/workflows/security-insights.yaml | Add least-privilege permissions, concurrency, and harden-runner auditing. |
| .github/workflows/release.yaml | Default-deny permissions at workflow level; minor hardening of $GITHUB_OUTPUT writes. |
| .github/workflows/pr-title.yml | Rename/remove old .yml workflow file. |
| .github/workflows/pr-title.yaml | Add renamed workflow with least-privilege permissions and concurrency. |
| .github/workflows/post-merge.yaml | Default-deny permissions and add harden-runner; scope contents: write to the job. |
| .github/workflows/osps-security-assessment.yaml | Default-deny permissions and add harden-runner auditing. |
| .github/workflows/lint.yaml | Default-deny permissions, add concurrency, and add harden-runner auditing. |
| .github/workflows/integration.yaml | Default-deny permissions, add concurrency, add harden-runner, and quote base ref usage. |
| .github/workflows/ci.yaml | Default-deny permissions, add concurrency, add harden-runner, and quote base ref usage. |
| .github/workflows/auto-labeler.yaml | Default-deny permissions and add concurrency for pull_request_target workflow. |
Comments suppressed due to low confidence (2)
.github/workflows/osps-security-assessment.yaml:19
- This job uploads artifacts via actions/upload-artifact, but the job-level permissions omit
actions: write. With top-levelpermissions: {}this will make the upload step fail with insufficient token scopes.
.github/workflows/auto-labeler.yaml:12 - The concurrency group for this
pull_request_targetworkflow is based ongithub.head_ref, which is PR-author-controlled and can collide across unrelated PRs (potentially cancelling other runs). Using the PR number makes the group stable and avoids cross-PR collisions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## What/Why Address PR review: author-controlled github.head_ref can collide across unrelated PRs that share a source branch name, cancelling each other's runs. github.event.pull_request.number is unique per PR, so use it for the pull_request_target workflows (pr-title, auto-labeler). ## Proof it works actionlint clean on both changed workflows. ## Risk + AI role Low -- concurrency group key only, pull_request_target workflows where the PR number is always present. AI-generated (Claude Opus 4.8). ## Review focus - Left the pull_request workflows on head_ref || ref, since they also run on push where the PR number does not exist. Signed-off-by: jmeridth <jmeridth@gmail.com>
eddie-knight
approved these changes
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why
Apply least-privilege permissions, harden-runner egress auditing, and PR concurrency across all workflows, and rename them to
.yaml, to meet the repo's GitHub Actions standards and clear open code-scanning alerts (#169, #178 missing workflow permissions onci; #179 unsanitizedgithub.base_ref).Proof it works
actionlintreports no issues andmake testpasses. Workflow renames preserve every job id andname:, so the six required status checks (CI,Integration Tests,golang,markdown,auto_labeler / ...,lint_pr_title / ...) keep matching without touching the ruleset.Risk + AI role
Low -- workflow config and
.gitignoreonly, no application code. Each permission scope, concurrency choice, and the action version pins were reviewed by hand.Review focus
post-merge.yamlcontents: writescope for the BYOB badge action -- confirm it is actually required or can drop toread.pull_request_targetworkflows (auto-labeler,pr-title) and the intentional omission onrelease.yaml(releases must not be cancelled mid-run).