Skip to content

ci: harden GitHub Actions workflows#18

Merged
flavorjones merged 9 commits intomainfrom
harden-github-actions
Mar 20, 2026
Merged

ci: harden GitHub Actions workflows#18
flavorjones merged 9 commits intomainfrom
harden-github-actions

Conversation

@flavorjones
Copy link
Copy Markdown
Member

Summary

  • Add GitHub Actions audit job (actionlint + zizmor) to CI
  • Add lint-actions Makefile target for local workflow linting
  • Update dependabot cooldowns to 7 days
  • Pin all actions to SHA hashes with pinact
  • Fix zizmor findings across all workflows including seed templates
  • Move all permissions to job-level with permissions: {} at workflow level

Test plan

  • CI passes (actionlint + zizmor clean)
  • Existing workflow jobs still work

🤖 Generated with Claude Code

flavorjones and others added 9 commits March 20, 2026 14:36
Add a lint-actions job near the existing lint job to audit GitHub Actions
workflows on every push and PR to main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Increase cooldown from 2 to 7 days for github-actions ecosystem to allow
more soak time before updates are proposed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run actionlint and zizmor locally via `make lint-actions`, included in
the full `check-all` suite.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run pinact to ensure all action references include full version comments
alongside their SHA pins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Apply dual bot-conditions check on dependabot-auto-merge workflows
- Suppress dangerous-triggers on pull_request_target workflows that only
  run trusted actions (no PR code checkout)
- Move excessive-permissions to job-level in release workflows
- Suppress cache-poisoning on branch-isolated caches in release workflows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix ref-version-mismatch in seed workflows (update version comments)
- Suppress secrets-outside-env on private module tokens in seed CI
  workflows where environment protection would block PR-triggered runs
- Move excessive-permissions to job-level in seed/security.yml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add persist-credentials: false to all checkout steps (artipacked)
- Fix dependabot cooldown: add default-days: 7 to gomod ecosystem
- Fix seed dependabot cooldown: add default-days: 7 to both ecosystems

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Set permissions: {} at workflow level for all single-job and multi-job
workflows, with scoped permissions on each job. This ensures every job
starts with zero permissions and fails safe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move top-level permissions to permissions: {} for test.yml, security.yml,
scorecard.yml and all corresponding seed workflows. Add per-job
permissions: contents: read to every job.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 20, 2026 18:51
@github-actions
Copy link
Copy Markdown

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/ai-labeler.yml
  • .github/workflows/dependabot-auto-merge.yml
  • .github/workflows/direct-push-alert.yml
  • .github/workflows/labeler.yml
  • .github/workflows/release.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/security.yml
  • .github/workflows/sensitive-change-gate.yml
  • .github/workflows/test.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the repository’s GitHub Actions configuration by reducing default token permissions, pinning third-party actions, and adding workflow linting/auditing to CI and local tooling.

Changes:

  • Set workflow-level permissions: {} and move required permissions down to individual jobs.
  • Pin/update GitHub Actions dependencies (and add persist-credentials: false to checkouts) to improve supply-chain posture.
  • Add a GitHub Actions audit job (actionlint + zizmor) to CI and a make lint-actions target; update Dependabot cooldowns.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Makefile Adds lint-actions target and includes it in check-all.
.github/dependabot.yml Updates cooldown defaults and normalizes directory: "/" for GitHub Actions updates.
.github/workflows/test.yml Pins action versions, job-scopes permissions, and adds a CI job to run actionlint + zizmor.
.github/workflows/security.yml Pins action versions, job-scopes permissions, and hardens checkout credentials handling.
.github/workflows/scorecard.yml Switches to workflow-level permissions: {} and pins SARIF upload action.
.github/workflows/release.yml Switches to workflow-level permissions: {}, job-scopes permissions, and hardens checkout configuration.
.github/workflows/labeler.yml Moves permissions to job-level for pull_request_target labeler workflow.
.github/workflows/ai-labeler.yml Moves permissions to job-level for reusable AI labeling workflows.
.github/workflows/sensitive-change-gate.yml Moves permissions to job-level for reusable sensitive change gating workflow.
.github/workflows/direct-push-alert.yml Moves permissions to job-level for reusable direct-push alert workflow.
.github/workflows/dependabot-auto-merge.yml Moves permissions to job-level, strengthens Dependabot bot checks, pins fetch-metadata action.
seed/.github/dependabot.yml Updates Dependabot cooldown defaults in the seed template.
seed/.github/workflows/test.yml Applies job-level permissions, pins action versions, and hardens checkout in the seed test workflow.
seed/.github/workflows/security.yml Applies job-level permissions, pins action versions, and hardens checkout in the seed security workflow.
seed/.github/workflows/scorecard.yml Applies job-level permissions and pins SARIF upload action in the seed scorecard workflow.
seed/.github/workflows/release.yml Applies job-level permissions, pins action versions, and hardens checkout in the seed release workflow.
seed/.github/workflows/labeler.yml Applies job-level permissions for seed labeler workflow.
seed/.github/workflows/ai-labeler.yml Applies job-level permissions and hardens checkout for seed AI labeling workflow.
seed/.github/workflows/dependabot-auto-merge.yml Applies job-level permissions and strengthens bot conditions for seed Dependabot auto-merge workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread seed/.github/workflows/release.yml
Comment thread seed/.github/workflows/test.yml
@flavorjones flavorjones merged commit a5b14ed into main Mar 20, 2026
26 checks passed
@flavorjones flavorjones deleted the harden-github-actions branch March 20, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci enhancement New feature or request seed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants