Skip to content

Add workload identity federation support - #297

Merged
DMarby merged 5 commits into
mainfrom
dmarby/buf-wif
Sep 22, 2026
Merged

DMarby merged 5 commits into
mainfrom
dmarby/buf-wif

Conversation

@DMarby

@DMarby DMarby commented Sep 9, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-actions

This comment has been minimized.

@emcfarlane emcfarlane left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, small comments.

Comment thread action.yml Resolved
Comment thread action.yml Resolved
Comment thread README.md Resolved
Comment thread src/federation.test.ts Outdated
Comment on lines +21 to +22
// A GitHub OIDC token with a decodable payload, so tests can check that debug
// output reports claims without ever reproducing the token or its segments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have limited unit tests as most of the complication occurs with the interactions in GitHub and ensuring everything still runs. Maybe this would be better as a full e2e example in ci.yaml to avoid having to spin up a test repo.

@DMarby DMarby Sep 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Let me drop this and then add an e2e test as a follow-up since we need to get it rolled out on buf.build/configured there for that

Comment thread src/main.ts Resolved
Comment thread README.md Resolved
Rename the "username" input to "bot_username".
The registry accepts only machine users for this exchange, and the old
"username" input meant something different before it was dropped, so
reusing the name would change the behaviour of workflows that still carry
it.

Fail the action when a static token and a bot username are both set.
A silent precedence rule leaves the author believing they authenticate by
federation while a stored secret is what grants access.

Link the BSR authentication docs from both inputs, and move the debug
logging notes into the existing Debugging section.
Group the federation troubleshooting table with the debug logging notes,
so everything needed when a run misbehaves sits in one place.

Drop the note that setting both credentials fails.
The error says so when it happens, and the inputs do not need to document
every combination that is refused.
@DMarby
DMarby added this pull request to stack #299 September 11, 2026 18:21
The exchange only breaks where the action meets GitHub, and the unit tests
stub exactly that out, so they cannot catch a regression in it.
The end-to-end jobs cover it on a real runner instead.

Revert the test runner, the Makefile target, and the tsconfig options that
existed only to run this file.
The exchange options took an injectable fetch, sleep, and @actions/core
surface so the unit tests could stub them.
Nothing injects them now, so call the real ones directly.
- uses: bufbuild/buf-action@v1
with:
# The bot user to authenticate as. Used instead of "token".
bot_username: my-bot-user

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DMarby DMarby Sep 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? 😅 I used underscores since all our other inputs seem to use them, but maybe not ideal naming

github_actor:

Comment thread README.md
The BSR checks that against a trust credential you configure on the bot user and hands back a short-lived token.
The action revokes that token when the job finishes.

Set `bot_username` instead of [`token`](https://buf.build/docs/bsr/authentication/), and grant the job `id-token: write` so GitHub will sign a token for it:

@DMarby DMarby Sep 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docs page will contain instructions for WIF as well once before we merge

@DMarby
DMarby merged commit 3d3cd46 into main Sep 22, 2026
43 checks passed
@DMarby
DMarby deleted the dmarby/buf-wif branch September 22, 2026 15:41
@emcfarlane emcfarlane mentioned this pull request Sep 22, 2026
emcfarlane added a commit that referenced this pull request Sep 22, 2026
## What's Changed
* Update GHA examples by @pkwarren in
#286
* Default push and archive to skip on forked repositories by @emcfarlane
in #296
* Add workload identity federation support by @DMarby in
#297
* Add end-to-end tests for workload identity federation by @DMarby in
#298

## New Contributors
* @pkwarren made their first contribution in
#286
* @DMarby made their first contribution in
#297

**Full Changelog**:
v1.5.0...v1.6.0
github-actions Bot added a commit to step-security/buf-action that referenced this pull request Oct 22, 2026
## What's Changed
* Update GHA examples by @pkwarren in
bufbuild/buf-action#286
* Default push and archive to skip on forked repositories by @emcfarlane
in bufbuild/buf-action#296
* Add workload identity federation support by @DMarby in
bufbuild/buf-action#297
* Add end-to-end tests for workload identity federation by @DMarby in
bufbuild/buf-action#298

## New Contributors
* @pkwarren made their first contribution in
bufbuild/buf-action#286
* @DMarby made their first contribution in
bufbuild/buf-action#297

**Full Changelog**:
bufbuild/buf-action@v1.5.0...v1.6.0
github-actions Bot added a commit to step-security/buf-action that referenced this pull request Oct 22, 2026
## What's Changed
* Update GHA examples by @pkwarren in
bufbuild/buf-action#286
* Default push and archive to skip on forked repositories by @emcfarlane
in bufbuild/buf-action#296
* Add workload identity federation support by @DMarby in
bufbuild/buf-action#297
* Add end-to-end tests for workload identity federation by @DMarby in
bufbuild/buf-action#298

## New Contributors
* @pkwarren made their first contribution in
bufbuild/buf-action#286
* @DMarby made their first contribution in
bufbuild/buf-action#297

**Full Changelog**:
bufbuild/buf-action@v1.5.0...v1.6.0
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.

3 participants