Skip to content

ci: harden GitHub Actions workflows#109

Merged
flavorjones merged 8 commits intomasterfrom
harden-github-actions
Mar 20, 2026
Merged

ci: harden GitHub Actions workflows#109
flavorjones merged 8 commits intomasterfrom
harden-github-actions

Conversation

@flavorjones
Copy link
Member

Summary

  • Add GitHub Actions audit job (actionlint + zizmor) to CI workflow
  • Update dependabot github-actions cooldown
  • Pin all actions to SHA hashes with pinact
  • Fix high and low severity zizmor findings
  • 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

Copilot AI review requested due to automatic review settings March 20, 2026 17:39
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

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/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
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 9 files

Copy link

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

Hardens this repository’s GitHub Actions configuration by tightening default token permissions, pinning actions, and adding CI auditing for workflows to reduce supply-chain and misconfiguration risk.

Changes:

  • Set workflow-level permissions: {} and define least-privilege permissions per job across workflows.
  • Pin GitHub Actions to commit SHAs and disable persisted checkout credentials (persist-credentials: false).
  • Add a new “GitHub Actions audit” CI job running actionlint and zizmor; adjust Dependabot cooldown defaults.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/test.yml Locks down permissions, pins actions, and adds an actionlint/zizmor audit job.
.github/workflows/sensitive-change-gate.yml Moves permissions to job-level and documents pull_request_target risk acceptance.
.github/workflows/security.yml Pins actions, scopes permissions per job, and disables persisted credentials on checkout.
.github/workflows/scorecard.yml Removes workflow-wide permissions and pins actions while keeping required job permissions.
.github/workflows/release.yml Pins actions, scopes permissions, and disables persisted checkout credentials for release jobs.
.github/workflows/direct-push-alert.yml Moves permissions to job-level and sets workflow-level permissions to none.
.github/workflows/dependabot-auto-merge.yml Tightens bot gating condition and pins Dependabot metadata action.
.github/workflows/ai-labeler.yml Moves permissions to job-level and documents pull_request_target risk acceptance.
.github/dependabot.yml Increases default cooldown window to reduce Dependabot PR frequency.

[!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.


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

@github-actions github-actions bot added the enhancement New feature or request label Mar 20, 2026
flavorjones and others added 8 commits March 20, 2026 14:42
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Suppress dangerous-triggers in ai-labeler and sensitive-change-gate
  (both only call reusable workflows, no PR code checked out)
- Fix bot-conditions with dual check in dependabot-auto-merge
- Suppress cache-poisoning in release (branch-isolated default cache)

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace overly broad workflow-level permissions with permissions: {}
in ai-labeler, direct-push-alert, and sensitive-change-gate. Each
job already declares its own scoped permissions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move workflow-level permissions to permissions: {} in scorecard and
test workflows, adding explicit job-level permissions for each 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
@flavorjones flavorjones force-pushed the harden-github-actions branch from 83b662a to 55b803a Compare March 20, 2026 18:51
Copy link

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


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

@flavorjones flavorjones merged commit a04a388 into master Mar 20, 2026
23 checks passed
@flavorjones flavorjones deleted the harden-github-actions branch March 20, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants