What's the Motivation? π€
The soroush-tech/bench-action gate posts its results comment as github-actions[bot]. For the Marketplace release we want the comment authored by our own bot identity (name + avatar) in any consumer repo β the way codecov[bot] works β with zero secrets or token setup for consumers. Comment authorship on GitHub is determined by the token that posts it, and minting a branded token requires the GitHub App's private key, which can never ship inside a public action. The only sound design is a small hosted relay that holds the key.
What are the requirements? β
- Consumers configure nothing beyond installing the public GitHub App and granting
id-token: write; no secrets, no backend accounts.
- The action never gets worse: any relay failure (app not installed, no OIDC permission, relay down) falls back to the current direct comment, and comment failures never affect the gate verdict.
- The relay can only post to the repo that called it (no spoofing), is rate-limited, and holds the app key as a Cloudflare secret.
- 100% test coverage on all covered modules in both repos, per existing standards.
What are our options? π‘
- Per-repo app-token wiring (mint an installation token in each consumer's workflow) β requires every consumer to hold our app's private key: impossible for a public action.
- No branding β keep
github-actions[bot]; zero effort, but not the product we want on the Marketplace.
- Hosted relay + GitHub App (proposed) β the Codecov model; the key stays on our infrastructure, consumers get one-click install.
Proposed solution π’
A dedicated Cloudflare Worker workers/bench (@soroush/bench-api) at api.bench.soroush.tech, mirroring workers/api's conventions. Flow:
- The action (running in the consumer's workflow) requests a GitHub Actions OIDC token (
core.getIDToken('soroush-bench-action')) and POSTs { repository, prNumber, body } to /v1/report with the JWT as bearer auth.
- The relay verifies the JWT (issuer JWKS, signature, audience, expiry) and trusts only its
repository claim as the caller's identity.
- It mints a GitHub App installation token for that repo (App JWT via
crypto.subtle RS256 β zero new dependencies) and upserts the marker-matched sticky comment as the bot. 404 when the app isn't installed β the action falls back silently.
- Action side ships in bench-action v1.1.0 together with the zero-config
github-token default: a covered relay.ts client, a branded input (default 'true'), and fallback wiring. Release to the Marketplace only after the relay is live.
Risks & mitigations π¨
- Abuse / spoofing β posting is confined to the OIDC-verified
repository claim (self-spam only); body must start with the report marker and is size-capped; per-IP rate limit.
- Relay outage / JWKS failure β graceful fallback to the unbranded comment; the gate verdict is never touched.
- Fork PRs (no
id-token permission) β fallback path, documented.
- Key management β PKCS#8 key stored only as a Worker secret; rotation = new key +
wrangler secret put, no action release.
- Pre-existing comments β an existing unbranded sticky comment keeps its original author when updated; documented (delete once to rebrand).
Resources and benchmarks π
What's the Motivation? π€
The
soroush-tech/bench-actiongate posts its results comment asgithub-actions[bot]. For the Marketplace release we want the comment authored by our own bot identity (name + avatar) in any consumer repo β the way codecov[bot] works β with zero secrets or token setup for consumers. Comment authorship on GitHub is determined by the token that posts it, and minting a branded token requires the GitHub App's private key, which can never ship inside a public action. The only sound design is a small hosted relay that holds the key.What are the requirements? β
id-token: write; no secrets, no backend accounts.What are our options? π‘
github-actions[bot]; zero effort, but not the product we want on the Marketplace.Proposed solution π’
A dedicated Cloudflare Worker
workers/bench(@soroush/bench-api) atapi.bench.soroush.tech, mirroringworkers/api's conventions. Flow:core.getIDToken('soroush-bench-action')) andPOSTs{ repository, prNumber, body }to/v1/reportwith the JWT as bearer auth.repositoryclaim as the caller's identity.crypto.subtleRS256 β zero new dependencies) and upserts the marker-matched sticky comment as the bot.404when the app isn't installed β the action falls back silently.github-tokendefault: a coveredrelay.tsclient, abrandedinput (default'true'), and fallback wiring. Release to the Marketplace only after the relay is live.Risks & mitigations π¨
repositoryclaim (self-spam only); body must start with the report marker and is size-capped; per-IP rate limit.id-tokenpermission) β fallback path, documented.wrangler secret put, no action release.Resources and benchmarks π