Skip to content

ci: open the update and Helm/changelog PRs as coder-automations - #8153

Open
kylecarbs wants to merge 2 commits into
mainfrom
ci/repo-job-app-token
Open

kylecarbs wants to merge 2 commits into
mainfrom
ci/repo-job-app-token

Conversation

@kylecarbs

@kylecarbs kylecarbs commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The org doesn't let GITHUB_TOKEN create pull requests, so two jobs can't open their PRs:

  • publish.yaml repo (Helm chart and changelog after a release). v4.146.0's run pushed helm/4.146.0, then failed with GitHub Actions is not permitted to create or approve pull requests. Update Helm chart and changelog with 4.146.0 #8152 was opened by hand.
  • update.yaml (the scheduled "Update Code to X" PR, which release.yaml releases once merged). It will fail the same way on the next VS Code release.

Both now:

  1. check out with persist-credentials: false, then run their update script with no write token around;
  2. mint a coder-automations token through Cloud KMS, scoped to coder/code-server with contents and pull-request write;
  3. gh auth setup-git, push the branch, and open the PR with that token.

GITHUB_TOKEN drops to contents: read. update runs in a new main-only update environment, because the KMS pool only admits jobs that run in an environment. repo runs in release, which publish.yaml's other jobs already use. A side benefit: PRs opened by an App trigger CI, which PRs created by GITHUB_TOKEN never did.

Merge after: coder/github-org-terraform#201 (the update env) and coder/gcp#470 (lets update.yaml@main in update sign as coder-automations) are applied, and the update env has the three App secrets. coder-automations is already installed on coder/code-server.

actionlint is clean apart from existing shellcheck info notes. zizmor shows no new findings, and two fewer artipacked warnings.
Also: publish.yaml's npm job sets package-manager-cache: false on setup-node. A cache saved by another run could otherwise reach the job that publishes to npm (zizmor cache-poisoning, high).

🤖 Generated with Claude Code

The org doesn't let GITHUB_TOKEN create pull requests, so publish.yaml's
repo job failed to open the v4.146.0 Helm/changelog PR, and update.yaml
will fail to open the next "Update Code to X" PR.

Both jobs now check out without persisted credentials, run their update
script, then mint a coder-automations token (Cloud KMS) for
coder/code-server only, and push and open the PR with it. update.yaml
runs in the new main-only update environment; the repo job in release.
GITHUB_TOKEN drops to contents: read. PRs opened by the App also trigger
CI, which GITHUB_TOKEN-created ones didn't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs requested a review from a team as a code owner November 20, 2026 20:22
setup-node caches the package manager's store by default, so a cache
saved by another run could reach the job that publishes to npm. Turn it
off there (zizmor cache-poisoning).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylecarbs
kylecarbs enabled auto-merge (squash) November 20, 2026 20:28

This branch has not been deployed

No deployments
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