Enhance CI workflows with GitHub App tokens and centralized publishing#4876
Enhance CI workflows with GitHub App tokens and centralized publishing#4876arturcic merged 10 commits intoGitTools:mainfrom
Conversation
…lishing conditions
Retrieve NuGet and Chocolatey API keys via standardized actions from a secret management system.
… write permission
Enhance security by replacing a long-lived repository secret with ephemeral, permission-scoped GitHub App tokens for publishing actions.
Ensure package publication occurs only from the main branch of the GitTools repository, excluding pull requests.
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s GitHub Actions release/publish automation to use GitHub App–based auth and centralized secret retrieval (via gittools/cicd/*-creds actions), while also adding a single “can publish” flag to consistently gate publishing behavior across reusable workflows.
Changes:
- Introduces GitHub App token generation (via
gittools/cicd/gh-app-creds@main+actions/create-github-app-token@v3) for Homebrew/Winget/GitTools Actions update workflows and switches those flows off ofRELEASE_GITHUB_TOKEN. - Adds a
publish_flagsjob in CI and threads boolean publish inputs into reusable workflows to control coverage uploads, Docker publishing, and package publishing. - Moves DockerHub/NuGet/Chocolatey credentials acquisition to dedicated
gittools/cicd/*-creds@mainsteps and standardizes on${{ github.token }}where appropriate.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/winget.yml | Switches Winget manifest bump flow to GitHub App token auth (and passes it via GITHUB_TOKEN). |
| .github/workflows/release.yml | Uses ${{ github.token }} for repository dispatch and formats payload as JSON block; adjusts outputs naming. |
| .github/workflows/homebrew.yml | Uses GitHub App token auth for Homebrew formula bumping and targets a specific push-to repository. |
| .github/workflows/gittools-actions.yml | Uses GitHub App token auth to dispatch release-published events to the actions repo. |
| .github/workflows/docs.yml | Replaces secrets.GITHUB_TOKEN usage with ${{ github.token }} for remark-lint. |
| .github/workflows/ci.yml | Adds publish_flags gating and wires publish booleans into reusable workflows; switches to credential loader for DockerHub in release job. |
| .github/workflows/_unit_tests.yml | Adds publish_coverage input and gates Codecov uploads on that boolean. |
| .github/workflows/_publish.yml | Adds publish_packages input and loads NuGet/Chocolatey creds only when publishing is enabled. |
| .github/workflows/_docker.yml | Adds publish_images input and uses it to decide between docker test vs publish; loads DockerHub creds via credential loader. |
| .github/workflows/_docker_manifests.yml | Adds publish_manifests input to conditionally run manifest publishing and load DockerHub creds via credential loader. |
There was a problem hiding this comment.
Pull request overview
Updates GitHub Actions workflows to use GitHub App–issued tokens and centrally-gated “can publish” flags, while moving secret retrieval to shared gittools/cicd/*-creds actions for release/publish operations.
Changes:
- Add GitHub App credential loading + installation token generation for Winget/Homebrew/GitTools Actions automation.
- Introduce a
publish_flagsjob in CI and plumb boolean inputs through reusable workflows to control publishing (coverage, docker images/manifests, packages). - Standardize on
${{ github.token }}in multiple workflows and load DockerHub/NuGet/Chocolatey credentials viagittools/cicd/*-creds@v1.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/winget.yml | Switch Winget publishing to use a GitHub App token (and remove explicit token arg). |
| .github/workflows/release.yml | Use workflow github.token (with permissions) to dispatch the CI release event; payload formatting cleanup. |
| .github/workflows/homebrew.yml | Use a GitHub App token and target push-to fork/org for Homebrew bump automation. |
| .github/workflows/gittools-actions.yml | Use a GitHub App token for dispatching updates to the actions repo. |
| .github/workflows/docs.yml | Replace secrets.GITHUB_TOKEN usage with ${{ github.token }} for remark-lint. |
| .github/workflows/ci.yml | Add publish gating via publish_flags; switch DockerHub creds retrieval to gittools/cicd/dockerhub-creds@v1; update dispatch token usage. |
| .github/workflows/_unit_tests.yml | Add publish_coverage input and gate Codecov uploads on it. |
| .github/workflows/_publish.yml | Add publish_packages input; load NuGet/Chocolatey creds via gittools/cicd/*-creds@v1; gate publish step. |
| .github/workflows/_docker.yml | Add publish_images input; gate test vs publish and load DockerHub creds via gittools/cicd/dockerhub-creds@v1. |
| .github/workflows/_docker_manifests.yml | Add publish_manifests input; gate entire job; load DockerHub creds via gittools/cicd/dockerhub-creds@v1. |
af48ded to
e366d37
Compare
There was a problem hiding this comment.
Pull request overview
Updates the repository’s GitHub Actions release/publish automation to use GitHub App tokens and 1Password-sourced credentials, while centralizing “can publish” gating logic to reduce risk on forks/non-main refs.
Changes:
- Replace
RELEASE_GITHUB_TOKENusage with GitHub App tokens (Winget/Homebrew/GitTools Actions) and${{ github.token }}where appropriate. - Introduce a
publish_flagsjob inci.ymland thread boolean publish inputs into reusable workflows to control coverage upload, package publishing, and Docker publish/manifest creation. - Switch DockerHub/NuGet/Chocolatey credentials loading to
gittools/cicd/*-creds@v1actions gated behind publish flags.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/winget.yml | Uses GitHub App token (via 1Password) for Winget manifest updates; removes explicit token arg from komac invocation. |
| .github/workflows/release.yml | Uses ${{ github.token }} for repository dispatch and cleans up payload formatting/output naming. |
| .github/workflows/homebrew.yml | Uses GitHub App token (via 1Password) for Homebrew formula bumping and sets explicit push-to target. |
| .github/workflows/gittools-actions.yml | Uses GitHub App token (via 1Password) to dispatch update events to the actions repo. |
| .github/workflows/docs.yml | Uses ${{ github.token }} instead of secrets.GITHUB_TOKEN for remark-lint. |
| .github/workflows/ci.yml | Adds publish gating job/output; threads publish booleans into reusable workflows; gates DockerHub credential usage behind publish condition. |
| .github/workflows/_unit_tests.yml | Adds publish_coverage input and uses it to control Codecov uploads. |
| .github/workflows/_publish.yml | Adds publish_packages input; loads NuGet/Chocolatey creds via 1Password only when publishing. |
| .github/workflows/_docker.yml | Adds publish_images input; loads DockerHub creds and publishes only when enabled, otherwise runs docker tests. |
| .github/workflows/_docker_manifests.yml | Adds publish_manifests input and gates the manifest job accordingly; loads DockerHub creds from 1Password. |
e366d37 to
b05487e
Compare
|
|
Thank you @arturcic for your contribution! |



Goal
Define and enforce a consistent CI/CD publishing policy for GitVersion so release-oriented automation runs only in approved contexts and uses scoped credentials.
Scope
Expected Outcome
Non-Goals
Resolves #4877