Skip to content

ci: run release jobs in reviewed environments and tighten release.yaml - #193

Merged
deansheather merged 1 commit into
mainfrom
secrets/release-environments
Nov 18, 2026
Merged

deansheather merged 1 commit into
mainfrom
secrets/release-environments

Conversation

@deansheather

Copy link
Copy Markdown
Collaborator

Runs both jobs of release.yaml in reviewed environments and tightens the workflow, so the repository-level secrets can move into those environments. Part of moving coder repositories off repository-level secrets.

Depends on coder/github-org-terraform#134, which adds coder-desktop-release-managers as reviewers of code-signing, limits it to v* tags, and creates the winget environment. Merge this after that is applied. Otherwise GitHub creates winget on first use with no protection.

Changes (.github/workflows/release.yaml)

  • Triggers: only v* tag pushes. workflow_dispatch and its version input are removed, because they aren't needed: every Release run in the last year came from a tag push. The tag pattern was '*', but the version step already rejected anything that isn't vX.Y.Z.
  • Permissions: top-level permissions: {}.
    • release gets contents: write (create the release) and id-token: write (workload identity for EV signing and the appcast upload).
    • winget gets contents: read. It used to inherit both write permissions, but it uses cdrci's token for everything outside this repository.
  • winget job: environment: winget, so CDRCI_GITHUB_TOKEN can move there and only reaches this job after a release manager approves it.
  • Pins: actions/checkout v4.4.0, actions/setup-dotnet v4.3.1, actions/upload-artifact v4.6.2 and softprops/action-gh-release v2.6.2 are pinned to commit SHAs.
  • Checkout credentials: persist-credentials: false on both checkouts. git fetch --tags in winget still works because the repository is public.
  • jsign checksum: jsign-6.0.jar is checked against SHA-256 05ca18d4…fa8a before it signs anything. That is the same checksum coder/coder's build-coder action pins. I also computed it from the release asset myself.
  • Appcast tag: the appcast step reads the tag from $env:GITHUB_REF_NAME instead of expanding ${{ github.ref_name }} into the script.

Secrets afterwards

The secrets.NAME references stay as they are. Environment secrets take precedence over repository secrets with the same name, so each value is copied into its environment first and the repository copy is deleted after a release works.

Environment Secrets
code-signing GCP_WORKLOAD_ID_PROVIDER, GCP_SERVICE_ACCOUNT, EV_SIGNING_CERT, EV_KEYSTORE, EV_KEY, EV_TSA_URL, APPCAST_SIGNATURE_KEY_BASE64
winget CDRCI_GITHUB_TOKEN

APPCAST_SIGNATURE_KEY_BASE64 remains a stored key. Update-AppCast.ps1 signs each installer, not only the small appcast, with raw Ed25519 (openssl pkeyutl -rawin). Ed25519 signs the whole message rather than a hash, so a KMS key would have to receive the entire installer in every signing request.

Effect on releases

Pushing a v* tag starts the release as before. release waits for an approval from a desktop release manager other than the person who pushed the tag, and winget waits for one more after release finishes.

Checks

$ actionlint -shellcheck= .github/workflows/release.yaml
release.yaml:177:14: label "depot-windows-latest" is unknown ... [runner-label]   # also on main
$ zizmor --offline .github/workflows/release.yaml
main:   2 excessive-permissions, 1 template-injection, 1 unpinned-uses, 2 artipacked (errors/warnings)
branch: none (6 info-level template-injection findings, the same as main)

AI disclosure: an AI coding agent (Xum) wrote this change and ran the checks above at my direction. It stays a draft until I've reviewed it.

@deansheather

Copy link
Copy Markdown
Collaborator Author

@codex review

@deansheather
deansheather marked this pull request as ready for review November 18, 2026 11:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T11:30:07.759395Z cb68e92 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: cb68e92210

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@deansheather
deansheather merged commit 89a7f1a into main Nov 18, 2026
6 checks passed
@deansheather
deansheather deleted the secrets/release-environments branch November 18, 2026 11:41
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