Repository navigation
Publish with the ACR identities - #15
Conversation
Every job authenticated as github-actions-openops, with a client secret. That identity holds Contributor and Container Registry Repository Writer at *subscription* scope, which is the only reason the promote job can write to the public registry - and both assignments are being removed, so this workflow would have broken with no other symptom. Now the same two identities every other repository uses, by OIDC with nothing to rotate: build, manifest AZURE_ACR_CLIENT_ID private registry only promote AZURE_ACR_RELEASE_CLIENT_ID public registry, environment: release environment: release is not optional. The release credential's subject is repo:openops-cloud/openops-mcp:environment:release, so without the environment declared the token does not match and azure/login fails the same way a missing credential does. It is also where an approval gate for publishing publicly belongs. Registry names come from the organisation variables rather than being hardcoded, so this repository tracks the rest of the estate, and an unset one fails the step instead of building "/openops-mcp". One capability is lost: a dispatch from a branch other than main no longer authenticates, because the credential's subject is refs/heads/main and a dispatch presents its own ref. ci.yml already builds branches without pushing. The header says so. Requires openops-cloud/devops#291 applied first - it creates all three credentials - and a release environment on this repository. Part of OPS-4801 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Several az acr login steps rely on org vars for registry names without the same explicit fail-fast validation used elsewhere in the workflow, which can lead to harder-to-diagnose misconfiguration failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the Publish GitHub Actions workflow to publish images to Azure Container Registry using per-job OIDC identities and organization-level registry variables, reducing credential sprawl and scoping release promotions behind a protected environment.
Changes:
- Switched Azure auth from client-secret
creds:to OIDC (client-id+id-token: write) with separate identities for build vs release promotion. - Parameterized private/public ACR names and login servers via org
vars.*, and added fail-fast checks for login-server variables before Docker tagging/promotion. - Added
environment: releaseto the promote job to match the release federated credential subject and enable approval gating.
File summaries
| File | Description |
|---|---|
| .github/workflows/publish.yml | Migrates publish authentication to OIDC identities and uses org registry variables for private/public ACR targeting. |
Review details
Suppressed comments (2)
.github/workflows/publish.yml:119
- Same as in
build:az acr logindepends onvars.ACR_NAMEbut doesn’t fail fast if it’s unset. Adding an explicit${VAR:?}guard here makes misconfiguration errors much clearer.
- name: ACR login
run: az acr login --name ${{ vars.ACR_NAME }}
.github/workflows/publish.yml:163
- The promote job now uses
vars.ACR_NAMEandvars.ACR_PUBLIC_NAME, but only the login servers are validated later. If either registry name var is empty, the failure will come from Azure CLI with a less specific message. Consider validating both names here as well.
- name: ACR login
run: |
az acr login --name ${{ vars.ACR_NAME }}
az acr login --name ${{ vars.ACR_PUBLIC_NAME }}
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
From Copilot on #15. I guarded the login-server variables and left the registry names interpolated straight into the shell, so an unset ACR_NAME gave `az acr login --name` and an az CLI complaint about a missing argument that names no variable. Now every registry variable reaches the shell through env and is checked the same way. Nothing in a run block interpolates ${{ }} any more, which is also the shape that keeps expression values out of the script itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The estate promotes with `az acr import`; this job pulled the manifest through the runner with `docker buildx imagetools create` and pushed it to the public registry. Same result, more moving parts: blobs cross the runner, buildx has to be installed, and both registries need a docker login. Import is an ARM call the registry performs server-side. It copies a manifest list whole with its digest intact, so the promote job is now one login and one step, and it needs only the two Data Importer roles rather than data-plane Writer on the public registry. Also drops a stale reference to re-tagging "the tested ECR image". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Part of OPS-4801. Merge only after openops-cloud/devops#291 is applied — that PR creates the credentials this uses.
Why
Every job in this workflow authenticated as
github-actions-openops, with a client secret:That identity holds, at subscription scope:
The subscription-wide Writer is the only reason
promotecan write to the public registry — every other repository lost that path in openops-cloud/devops#289, which took the public-registry roles off the shared CI identity. Both assignments are on the list to remove, and this workflow would have broken with no other symptom.What changes
build,manifestAZURE_ACR_CLIENT_IDpromoteAZURE_ACR_RELEASE_CLIENT_IDenvironment: releaseOIDC in both cases — no client secret, nothing to rotate.
permissions: id-token: writeper job, since the workflow-level block only grantscontents: read.environment: releaseis not optionalThe release credential's subject is
repo:openops-cloud/openops-mcp:environment:release. Without the environment declared on the job the presented token doesn't match andazure/loginfails exactly the way a missing credential does. It's also where an approval gate for publishing to the registry customers pull from belongs.No new role assignments
The release identity already holds what
promoteneeds:docker buildx imagetools createacross registries wantsContainer Registry Repository Writeron the public registry andcontent/readon the private one, and eachaz acr loginwantsregistries/readon its own registry. Its three existing assignments cover all of it.Registry names come from organisation variables
vars.ACR_NAME,vars.ACR_LOGIN_SERVER,vars.ACR_PUBLIC_NAME,vars.ACR_PUBLIC_LOGIN_SERVERinstead of hardcoded hostnames, so this repository tracks the rest of the estate. An unset value fails the step via${VAR:?}rather than building/openops-mcpand failing on a reference nobody recognises.One capability lost
A
workflow_dispatchfrom a branch other thanmainno longer authenticates: the credential's subject isrefs/heads/main, and a dispatch presents the ref it ran from. Per-branch credentials aren't viable — there are 20 per application registration for the whole organisation.ci.ymlalready builds every branch and pull request, just without pushing, and the header comment now documents the restriction instead of promising branch builds.Also needed, not in this PR
A
releaseenvironment on this repository — it currently has onlycopilot. A job declaringenvironment: releasecreates it implicitly on first run but without required reviewers, so it's worth creating deliberately with the same protection the other repositories'releaseenvironments have.🤖 Generated with Claude Code