Repository navigation
Conversation
…environment The bee-runner key is an org secret, so any workflow on any branch can read it and mint a token that creates tags, bypassing the approval. The new release app's key lives only in this repo's release environment, which only runs from the default branch (and, for cut-release, after a second person approves).
Publishing jobs now read DOCKERHUB_USERNAME/PASSWORD from the release-ci environment (per-repo token, limited to this repo's images; default branch and release tags only) instead of the shared org secret.
repos.getCommit also resolves commits that are on no branch, such as fork PR heads under refs/pull/*. Refuse to tag unless the commit is on the default branch or a release/* branch, and show that branch in the run summary.
The run summary is what the release approver reviews. Escape the commit subject, ref and branch so a crafted subject can't alter it, and show the full SHA.
A line that starts with an inline <a> is still parsed as markdown by GitHub, so a commit URL in the subject was autolinked to another commit and a trailing backslash escaped </a>. Wrap the line in <p> so it is an HTML block with no markdown processing, and escape backslashes too.
Putting the commit subject, ref and branch into the summary and escaping them was too fragile. Each escaping attempt was bypassed: first raw HTML in the subject, then GitHub's markdown processing inside an inline <a> (autolinked commit URLs, a trailing backslash escaping </a>). The summary is what the release approver trusts, so it should not render any text an outsider can influence. The summary now shows only the full SHA (in <code>, so GitHub does not shorten it), fixed text saying whether the commit is on the default branch, and a commit link built from the SHA. Also: - fail if the ref does not resolve to a 40-hex SHA - drop the free-form ref from run-name
If createRelease failed after the tag was created, re-running the job failed with 'already exists' and left a tag without a release. Accept an existing tag only when it points at the approved SHA, and create the release only if it is missing.
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.
Adds a
Cut releaseworkflow. After this, release tags for this repo are created only by CI, never pushed by hand.How a release works now:
1.1.12) and the branch or commit to tag (defaultmain).releaseenvironment. A second person (not the one who started the run) approves it.publish_docker.yamlas before.Why: since the 2026-11-09 supply chain incident, publishing must need two people. Once this is merged, a ruleset will block tag creation for everyone except org owners and the bee-runner app, as already done on
bee.All actions are pinned to a commit SHA, and the app token only gets
contents: write.Before merging: the repo needs access to the
BEE_RUNNER_KEYorg secret and areleaseenvironment (devops will set both up).Update: tags are now created by the
bee-releaserapp, not bee-runner.The bee-runner key is an org secret, so any workflow on any branch could read it and create tags without approval (thanks for the review). The new app's key is stored only in this repo's
release/release-cienvironment (RELEASE_APP_KEY, app id invars.RELEASE_APP_ID). That environment only runs from the default branch, and for cut-release only after a second person approves. Tag rulesets will allow only org owners and this app.Do not merge before devops has set up the environment (
infra/ansible/github-release-app.yml).Docker Hub credentials (release-ci environment)
Image-publishing jobs now run in the
release-cienvironment, which holds a per-repo Docker Hub access token (DOCKERHUB_USERNAME/DOCKERHUB_PASSWORD) limited to this repo's images and usable only from the default branch / release tags. After merge, the shared org-level Docker Hub secret will be unshared from this repo.Cut-release summary: SHA only
The cut-release run summary is what the release approver looks at before approving. It used to show the commit subject, the ref and the branch, and tried to escape them. That approach was too fragile:
<a>version: GitHub still applied markdown inside the line, so a commit URL in the subject was autolinked to a different commit, and a trailing\escaped</a>(found by @akrem-chabchoub).Every fix just moved the edge case, so the summary no longer renders any text an outsider can influence. It now shows:
<code>so GitHub doesn't shorten it to 7 charactersThe approver opens the link to see the commit itself.
Also:
.or..resolved toundefined.run-name, which is what the run list and the approval notification show.Tested by running the real
resolvescript from each workflow file in about 22,600 runs with hostile tags, refs, commit messages and branch names, and rendering every summary through GitHub's markdown API. No untrusted text reached the summary.Same change in bee, storage-incentives, beeport, beekeeper and swarm-gateway.
Tag job is safe to re-run
If
createReleasefailed after the tag was created, re-running the job failed with "already exists" and left a tag without a release. Now an existing tag is accepted only if it points at the approved SHA, and the release is created only if it is missing. A tag at any other SHA still fails the job.