Repository navigation
ci: publish packages through environments, PR images to console-dev, pin actions - #134
Open
Gkrumbach07 wants to merge 1 commit into
Open
Gkrumbach07 wants to merge 1 commit into
Gkrumbach07 wants to merge 1 commit into
Conversation
…pin actions The organization's infra team (Simon) is setting up two environments, so that no job writes a package with the workflow's own token: - `release` (main and release/** only) holds GHCR_TOKEN, which can write to ghcr.io/ai-openshell/console and its chart. ci.yml's build (on a push), push-manifest, promote-latest and publish-dev-chart, and publish.yml's tag-image and publish-chart, log in with it. No job asks for packages: write any more. - `pr-images` (approved by a maintainer) holds a GHCR_TOKEN that can write to ghcr.io/ai-openshell/console-dev only. A new pr-image job builds console-dev:pr-<n> and :sha-<7> (linux/amd64) for a pull request from a branch of this repository, after approval. It runs on pull_request, never pull_request_target, and only reads the build cache. - A pull request no longer pushes anything to console, and writes no build cache: cache-to is for pushes only. - Every action in ci.yml is pinned by commit SHA, as publish.yml and follow-upstream.yml are. Tests hold all of it in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>
Gkrumbach07
force-pushed
the
ci/publish-environments
branch
from
November 10, 2026 20:18
efbf203 to
9f2128d
Compare
Gkrumbach07
had a problem deploying
to
pr-images
November 10, 2026 20:20 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #133, which is merged. Rebased onto
main.Why
Simon (infra) is setting up publishing so that no job writes a package with the workflow's own token, before the packages go public. This PR is the console side of that.
What changes
Releases publish through the
releaseenvironmentmainandrelease/**, and holdsGHCR_TOKEN, which can write toghcr.io/ai-openshell/consoleand its chart.ci.yml, on a push:build,push-manifest,promote-latest,publish-dev-chartpublish.yml:tag-image,publish-chartpackages: writeany more.image-rangestill reads with the workflow token.A pull request publishes nothing to
consolebuildstill builds both platforms on a PR, but pushes nothing and writes no build cache:cache-toonly runs on a push.builduses the environment only on a push (environment: ${{ github.event_name == 'push' && 'release' || '' }}), so a PR run has no environment and can't reach the token, even if it edits the workflow.PR images go to
console-dev, after approvalpr-imagejob runs in thepr-imagesenvironment. That environment'sGHCR_TOKENcan write toghcr.io/ai-openshell/console-devonly.console-dev:pr-<n>and:sha-<7>for linux/amd64.pull_request, notpull_request_target, as Simon asked, and only reads the cache. Fork PRs get no image, as intended.Every action in
ci.ymlis pinned by commit SHA, likepublish.ymlandfollow-upstream.yml.Tests now enforce all of this: no
packages: writeanywhere, the exact list of jobs that holdGHCR_TOKENand their environments, no cache written from a PR, thepr-imagerules, and SHA pinning acrossci.ymlandpublish.yml.docs/releasing.mdhas a new "Who can write the packages" section.Testing
python3 -m unittest discover -s deploy/ci/upstream: 277 passnode --test "scripts/**/*.test.mjs": 88 passNot tested live yet:
environment: ''), which I'm relying on to mean "no environment". If GitHub treats it differently, it shows up here first.Needs from infra before merge
Names assumed. Tell me if Simon's differ; each is one place to change:
release, with deployment branchesmainandrelease/**, and secretGHCR_TOKEN.pr-images, with required reviewers (maintainers), and secretGHCR_TOKEN(write onconsole-devonly).GHCR_USERNAMEin each, if the token needs a specific user name. Otherwise the run's actor is used.After merge (infra)
console, the chart andconsole-devare made public, after the oldpr-*images are deleted fromconsole.🤖 Generated with Claude Code