Repository navigation
test-companion: post as the BrowserStack GitHub App with no key in the repository - #98
Draft
naimish-browse wants to merge 1 commit into
Draft
naimish-browse wants to merge 1 commit into
naimish-browse wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
…vice, with no key in the repository Without app-id/app-private-key, the Action now asks GitHub for the job's OIDC identity token (audience test-companion.browserstack.com), sends it to BrowserStack's token service, and uses the App token it returns, limited to this repository. The App's key stays with the service. Any failure (no id-token: write, App not installed, service off or unreachable, a token for another repository) falls back to the workflow token with a one-line notice. Both tokens are masked as they arrive and redacted from everything posted; GitHub's identity-token variables are removed once spent and were never in the agent's allowlisted environment. The direct key path is unchanged. New inputs token-broker-url (https only) and app-slug, for a test service. The starter workflow gains id-token: write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
naimish-browse
force-pushed
the
test-companion-app-token-broker
branch
from
November 17, 2026 06:27
5377bd7 to
ce3396a
Compare
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.
Lets a customer's workflow post as the BrowserStack GitHub App without storing the App's key anywhere in their repository.
Needs the token service endpoint to be live (
POST https://test-companion.browserstack.com/api/github-app/token); until then every run falls back to the workflow token, as today.How it works
Without
app-id/app-private-key, the Action now:test-companion.browserstack.com(needspermissions: id-token: write);The App token is then used exactly like the one from the direct-key path: comments, checks and commits are credited to
browserstack[bot].Falling back
Any failure falls back to the workflow token, so the run carries on as
github-actions[bot], with a one-line notice saying why. That covers: noid-token: write, the App not installed (404), sign-in turned off (503), the service unreachable, and a token issued for another repository.Retries: up to 3 tries, 10s each, on network errors, 5xx (not 503) and 429. Never on 401/403/404/422/503.
Keeping the tokens safe
Changes
app-id/app-private-key: still sign in directly, unchanged. The token service is never called then.token-broker-url(https only, defaults to the service) andapp-slug(defaults tobrowserstack), for pointing at a test service and its App.<app-slug>[bot], and its user id is looked up with the new token, as the direct path does.id-token: write, and a note that installing the App needs no key.Tests
1026 pass, 0 fail, and no
not oklines (rebased onto v1.1.0). The newtest/token-broker.test.mjscovers:id-token: write→ no calls;🤖 Generated with Claude Code