Skip to content

Enhance release process with security hardening and package distribution - #6

Merged
IvMisticos merged 2 commits into
mainfrom
claude/laughing-knuth-hwumq7
Jun 19, 2026
Merged

Enhance release process with security hardening and package distribution#6
IvMisticos merged 2 commits into
mainfrom
claude/laughing-knuth-hwumq7

Conversation

@IvMisticos

Copy link
Copy Markdown
Owner

Summary

This PR significantly improves the release workflow and distribution capabilities by implementing security best practices in the GitHub Actions release pipeline and adding support for Homebrew and Scoop package managers.

Key Changes

GitHub Actions Workflow Security (goreleaser.yaml)

  • Principle of least privilege: Changed default permissions from contents: write to empty {}, granting only necessary permissions per-job
  • Manual approval gate: Added environment: release to require manual approval before releases, with environment-specific secrets for enhanced security
  • Concurrency control: Implemented concurrency group to prevent simultaneous releases for the same ref
  • Runner hardening: Added step-security/harden-runner action with egress audit policy to detect unexpected network calls
  • Pinned action versions: Updated all GitHub Actions to use specific commit SHAs instead of major version tags for supply chain security
  • Credential isolation: Configured git checkout to not persist default GITHUB_TOKEN, using environment variables and API instead
  • Fine-grained PAT: Introduced TAP_GITHUB_TOKEN environment secret scoped only to homebrew-tap and scoop-bucket repositories

Release Configuration (goreleaser.yaml)

  • Homebrew Cask support: Added homebrew_casks configuration to distribute binaries via Homebrew on macOS with:
    • Automatic quarantine attribute removal for unsigned binaries
    • Integration with custom homebrew-tap repository
  • Scoop support: Added scoops configuration for Windows package distribution via custom scoop-bucket
  • Release automation: Changed draft: false to enable automatic GitHub release publishing (approval is enforced at the Actions environment level)

Documentation (README.md)

  • Installation methods: Added Homebrew and Scoop installation instructions as primary distribution methods
  • Improved troubleshooting: Clarified cache invalidation issues and provided better guidance on clearing stale credentials
  • Better formatting: Improved readability of benchmark section and installation instructions
  • Typo fixes: Fixed "Configration" → "Configuration"

Notable Implementation Details

  • The release approval is enforced at the GitHub Actions environment level rather than in GoReleaser itself, allowing direct publishing once approved
  • macOS quarantine attributes are stripped via post-install hooks to avoid Gatekeeper prompts for unsigned binaries
  • Both kcc-cache and kcc-injector binaries are distributed through all package managers

https://claude.ai/code/session_01RZdU2QLP9bW65wiHKsaNaT

claude added 2 commits June 19, 2026 22:07
Add GoReleaser homebrew_casks and scoops sections targeting the
IvMisticos/homebrew-tap and IvMisticos/scoop-bucket repos, wire up the
TAP_GITHUB_TOKEN secret in the release workflow, and update the README
install instructions. Also trim redundant README content and fix typos.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZdU2QLP9bW65wiHKsaNaT
- Require manual approval via the `release` GitHub Actions environment
  before the release job runs; drop the draft release in favour of it.
- Pin all actions to commit SHAs to prevent tag-mutation supply-chain
  attacks against the secret-bearing job.
- Default top-level permissions to none; grant `contents: write` only to
  the release job.
- Add step-security/harden-runner (egress audit, disable sudo) and
  persist-credentials: false on checkout.
- Add concurrency guard so two releases can't run for the same ref.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZdU2QLP9bW65wiHKsaNaT
@IvMisticos
IvMisticos merged commit 5158557 into main Jun 19, 2026
5 checks passed
@IvMisticos
IvMisticos deleted the claude/laughing-knuth-hwumq7 branch June 19, 2026 22:31
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.

2 participants