Skip to content

security: harden GitHub Actions release workflow#1

Merged
ParthJadhav merged 1 commit intomainfrom
fix/github-actions-security
Mar 16, 2026
Merged

security: harden GitHub Actions release workflow#1
ParthJadhav merged 1 commit intomainfrom
fix/github-actions-security

Conversation

@ParthJadhav
Copy link
Copy Markdown
Owner

Summary

  • Fix script injection: All ${{ inputs.version }} in run: blocks replaced with environment variables to prevent shell injection via crafted version strings
  • Pin tauri-action to SHA: tauri-apps/tauri-action@v0@84b9d35b... — this action has access to all signing secrets (Apple certs, Azure creds, Tauri signing key)
  • Move validation first: Version format validation now runs before actions/checkout so it fails fast before any secrets/tokens are loaded
  • Per-job permissions: Replaced workflow-wide contents: write with per-job scoping — update-homebrew now only gets contents: read
  • Safe interpolation: jq --arg instead of string interpolation, awk -v instead of shell expansion in awk

Remaining manual actions

These can't be fixed via code:

  1. Enable branch protection on main — currently unprotected, any collaborator can force-push
  2. Audit RELEASE_TOKEN PAT scope — ensure it's a fine-grained PAT with minimal permissions (just contents: write on this repo)
  3. Audit HOMEBREW_TAP_TOKEN scope — ensure it's scoped only to homebrew-supervisor repo

Test plan

  • Trigger a test release with workflow_dispatch to verify version bumping still works with env vars
  • Verify tauri-action builds succeed with the pinned SHA
  • Confirm homebrew update step still generates correct cask file

🤖 Generated with Claude Code

- Fix script injection: replace all ${{ inputs.version }} in run blocks
  with env vars to prevent shell injection via crafted version strings
- Pin tauri-apps/tauri-action to commit SHA (was using mutable @v0 tag)
  — this action has access to all signing secrets
- Move validation step before checkout so it fails fast before any
  secrets are loaded
- Scope permissions per-job instead of workflow-wide: version-bump and
  build-and-release get contents:write, update-homebrew gets contents:read
- Use jq --arg for safe JSON value injection instead of string interpolation
- Use awk -v for safe variable passing instead of shell expansion in awk

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ParthJadhav ParthJadhav merged commit 66503ca into main Mar 16, 2026
5 checks passed
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