Skip to content

ci: create releases and tags via bee-runner app token - #808

Open
darkobas2 wants to merge 4 commits into
masterfrom
ci/release-app-token
Open

darkobas2 wants to merge 4 commits into
masterfrom
ci/release-app-token

Conversation

@darkobas2

@darkobas2 darkobas2 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Switches release-please from the bee-worker personal access token to a short-lived token for the bee-runner GitHub App.

Why: release tags will soon be restricted by a ruleset so that only CI (the bee-runner app) and org owners can create them. A personal token can't be a ruleset bypass, and it is a long-lived credential tied to one account.

  • The release PR and the GitHub release will be created by bee-runner[bot] instead of bee-worker.
  • Downstream workflows still trigger, since events created with an app token (unlike GITHUB_TOKEN) start workflows.
  • The tag-creation restriction is turned on only after one release has gone through this path.

Update: tags are now created by the bee-releaser app, 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-ci environment (RELEASE_APP_KEY, app id in vars.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).


Also in this PR: explicit token permissions. After this merges, the repo's default workflow token becomes read-only. Workflows that need write access now declare it: release asset uploads get contents: write, and the test coverage comparison gets actions: read and pull-requests: write.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Gemini review: pass

Reviewed b1ba9147d093, 2 file(s).

The PR updates the GitHub release workflow to generate a short-lived GitHub App token scoped to a protected environment instead of using a static PAT, pins the release actions to commit SHAs, and adds explicit permissions to workflows. Note that granting workflow-level pull-requests: write permission in tests.yaml gives all test steps write access to PRs when triggered from internal branches.

  • medium .github/workflows/tests.yaml:16: Setting pull-requests: write at the top-level workflow scope grants all jobs and steps in the test workflow write access to pull requests for internal branch triggers. To adhere to least privilege and reduce risk during test execution, set top-level permissions to contents: read and grant pull-requests: write and actions: read only to the specific job that posts the coverage comment.

Automated check. High/critical findings block merging; a human approval is still required. False positive? Ask devops to bypass.

The app token step handles the bee-runner private key, so a moved tag on any
action in this job could leak it. Pin every action here to a full commit SHA and
request only the permissions the job needs.
@darkobas2
darkobas2 deployed to gemini-review November 16, 2026 10:50 — with GitHub Actions Active
…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).
@darkobas2
darkobas2 deployed to gemini-review November 16, 2026 12:37 — with GitHub Actions Active
@darkobas2
darkobas2 deployed to gemini-review November 16, 2026 12:38 — with GitHub Actions Active
@darkobas2
darkobas2 deployed to gemini-review November 16, 2026 12:51 — with GitHub Actions Active
The repo default workflow token becomes read-only, so workflows that need write
access say so: release asset uploads get contents: write, the test coverage
comparison gets actions: read and pull-requests: write.
@github-actions

Copy link
Copy Markdown
Contributor
File Coverage Now Coverage Before Delta% Rating
Total 2681 / 3233 2681 / 3233 0.00
application.ts 0 / 2 0 / 2 0.00
config.ts 32 / 33 32 / 33 0.00
curl.ts 24 / 24 24 / 24 0.00
index.ts 0 / 16 0 / 16 0.00
printer.ts 3 / 7 3 / 7 0.00
command/addresses.ts 32 / 37 32 / 37 0.00
command/download.ts 30 / 39 30 / 39 0.00
command/hash.ts 8 / 10 8 / 10 0.00
command/quickstart.ts 34 / 37 34 / 37 0.00
command/reupload.ts 19 / 21 19 / 21 0.00
command/status.ts 81 / 81 81 / 81 0.00
command/upload.ts 233 / 271 233 / 271 0.00
command/access/access-command.ts 2 / 2 2 / 2 0.00
command/access/grant.ts 31 / 31 31 / 31 0.00
command/access/history.ts 28 / 31 28 / 31 0.00
command/access/index.ts 10 / 10 10 / 10 0.00
command/access/init.ts 27 / 27 27 / 27 0.00
command/access/list.ts 15 / 15 15 / 15 0.00
command/access/revoke.ts 31 / 31 31 / 31 0.00
command/access/show.ts 23 / 23 23 / 23 0.00
command/cheque/cashout.ts 30 / 32 30 / 32 0.00
command/cheque/cheque-command.ts 21 / 25 21 / 25 0.00
command/cheque/deposit.ts 16 / 16 16 / 16 0.00
command/cheque/index.ts 9 / 9 9 / 9 0.00
command/cheque/list.ts 13 / 13 13 / 13 0.00
command/cheque/withdraw-all.ts 6 / 15 6 / 15 0.00
command/cheque/withdraw.ts 16 / 16 16 / 16 0.00
command/feed/feed-command.ts 57 / 59 57 / 59 0.00
command/feed/index.ts 7 / 7 7 / 7 0.00
command/feed/print.ts 26 / 80 26 / 80 0.00
command/feed/update.ts 14 / 15 14 / 15 0.00
command/feed/upload.ts 26 / 28 26 / 28 0.00
command/history/disable.ts 18 / 18 18 / 18 0.00
command/history/enable.ts 15 / 15 15 / 15 0.00
command/history/history-command.ts 2 / 2 2 / 2 0.00
command/history/index.ts 9 / 9 9 / 9 0.00
command/history/list.ts 18 / 18 18 / 18 0.00
command/history/show.ts 26 / 28 26 / 28 0.00
command/history/status.ts 16 / 16 16 / 16 0.00
command/identity/create.ts 36 / 41 36 / 41 0.00
command/identity/export.ts 20 / 22 20 / 22 0.00
command/identity/identity-command.ts 21 / 27 21 / 27 0.00
command/identity/import.ts 50 / 63 50 / 63 0.00
command/identity/index.ts 11 / 11 11 / 11 0.00
command/identity/list.ts 21 / 21 21 / 21 0.00
command/identity/remove.ts 15 / 21 15 / 21 0.00
command/identity/rename.ts 16 / 16 16 / 16 0.00
command/identity/show.ts 27 / 33 27 / 33 0.00
command/manifest/add.ts 38 / 39 38 / 39 0.00
command/manifest/create.ts 16 / 17 16 / 17 0.00
command/manifest/download.ts 46 / 47 46 / 47 0.00
command/manifest/index.ts 11 / 11 11 / 11 0.00
command/manifest/list.ts 40 / 42 40 / 42 0.00
command/manifest/merge.ts 24 / 25 24 / 25 0.00
command/manifest/remove.ts 26 / 29 26 / 29 0.00
command/manifest/sync.ts 58 / 63 58 / 63 0.00
command/pinning/index.ts 8 / 8 8 / 8 0.00
command/pinning/list.ts 14 / 14 14 / 14 0.00
command/pinning/pin.ts 10 / 11 10 / 11 0.00
command/pinning/pinning-command.ts 5 / 8 5 / 8 0.00
command/pinning/reupload-all.ts 21 / 23 21 / 23 0.00
command/pinning/unpin.ts 11 / 11 11 / 11 0.00
command/pss/index.ts 7 / 7 7 / 7 0.00
command/pss/pss-command.ts 8 / 8 8 / 8 0.00
command/pss/receive.ts 18 / 24 18 / 24 0.00
command/pss/send.ts 29 / 34 29 / 34 0.00
command/pss/subscribe.ts 8 / 18 8 / 18 0.00
command/root-command/command-config.ts 35 / 41 35 / 41 0.00
command/root-command/command-log.ts 65 / 78 65 / 78 0.00
command/root-command/index.ts 48 / 52 48 / 52 0.00
command/root-command/printer.ts 9 / 9 9 / 9 0.00
command/stake/deposit.ts 30 / 45 30 / 45 0.00
command/stake/index.ts 8 / 8 8 / 8 0.00
command/stake/recover.ts 10 / 22 10 / 22 0.00
command/stake/status.ts 11 / 11 11 / 11 0.00
command/stake/withdraw.ts 7 / 25 7 / 25 0.00
command/stamp/buy.ts 50 / 64 50 / 64 0.00
command/stamp/create.ts 46 / 79 46 / 79 0.00
command/stamp/dilute.ts 12 / 27 12 / 27 0.00
command/stamp/extend.ts 10 / 51 10 / 51 0.00
command/stamp/index.ts 12 / 12 12 / 12 0.00
command/stamp/list.ts 29 / 31 29 / 31 0.00
command/stamp/rename.ts 16 / 17 16 / 17 0.00
command/stamp/show.ts 13 / 14 13 / 14 0.00
command/stamp/stamp-command.ts 3 / 7 3 / 7 0.00
command/stamp/topup.ts 11 / 23 11 / 23 0.00
command/utility/cid.ts 8 / 13 8 / 13 0.00
command/utility/create-batch.ts 35 / 38 35 / 38 0.00
command/utility/index.ts 14 / 22 14 / 22 0.00
command/utility/lock.ts 7 / 11 7 / 11 0.00
command/utility/rchash.ts 27 / 27 27 / 27 0.00
command/utility/redeem.ts 43 / 51 43 / 51 0.00
command/utility/unlock.ts 7 / 12 7 / 12 0.00
command/wallet/index.ts 7 / 7 7 / 7 0.00
command/wallet/status.ts 11 / 11 11 / 11 0.00
command/wallet/withdraw-bzz.ts 19 / 21 19 / 21 0.00
command/wallet/withdraw-dai.ts 19 / 21 19 / 21 0.00
service/version_checker.ts 24 / 28 24 / 28 0.00
service/access/index.ts 29 / 31 29 / 31 0.00
service/access/types/history-event.ts 5 / 5 5 / 5 0.00
service/history/index.ts 19 / 21 19 / 21 0.00
service/identity/index.ts 32 / 36 32 / 36 0.00
service/identity/types/identity.ts 4 / 4 4 / 4 0.00
service/identity/types/index.ts 1 / 1 1 / 1 0.00
service/stamp/index.ts 30 / 32 30 / 32 0.00
utils/bzz-address.ts 24 / 30 24 / 30 0.00
utils/chainsync.ts 4 / 4 4 / 4 0.00
utils/contracts.ts 6 / 6 6 / 6 0.00
utils/error.ts 41 / 53 41 / 53 0.00
utils/hex.ts 10 / 14 10 / 14 0.00
utils/index.ts 65 / 83 65 / 83 0.00
utils/message.ts 3 / 12 3 / 12 0.00
utils/mime.ts 5 / 5 5 / 5 0.00
utils/option.ts 5 / 5 5 / 5 0.00
utils/progress.ts 17 / 24 17 / 24 0.00
utils/qr.ts 5 / 5 5 / 5 0.00
utils/redundancy.ts 10 / 13 10 / 13 0.00
utils/rpc.ts 43 / 50 43 / 50 0.00
utils/spinner.ts 15 / 15 15 / 15 0.00
utils/text.ts 24 / 26 24 / 26 0.00
utils/url.ts 6 / 6 6 / 6 0.00
utils/validate.ts 9 / 11 9 / 11 0.00

@darkobas2
darkobas2 requested review from Cafe137 and removed request for Cafe137 November 23, 2026 17:52

This branch was successfully deployed

1 active deployment
gemini-review — b1ba9147 Deployed Nov 16, 2026 by darkobas2 via gemini-review #14
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