Skip to content

Conversation

woodruffw
Copy link
Contributor

TL;DR: job_workflow_ref and workflow_ref are
often the same thing and have the same value,
but sometimes diverge in ways that make later
support for GitHub's reusable workflows difficult.

This guide should recommend workflow_ref instead of job_workflow_ref for the "baseline" of Trusted
Publishing, since it's always correct as the
"initiating" workflow identity.

See pypi/warehouse#11096 and rust-lang/crates.io#11131 (comment) for more context.

CC @sethmlarson

TL;DR: `job_workflow_ref` and `workflow_ref` are
*often* the same thing and have the same value,
but sometimes diverge in ways that make later
support for GitHub's reusable workflows difficult.

This guide should recommend `workflow_ref` instead of
`job_workflow_ref` for the "baseline" of Trusted
Publishing, since it's always correct as the
"initiating" workflow identity.

See pypi/warehouse#11096
and rust-lang/crates.io#11131 (comment)
for more context.

Signed-off-by: William Woodruff <[email protected]>
Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

Nice catch!

Just to make sure we're on the same page, workflow_ref will always refer to the repository that initiated the run (e.g. my-org/my-repo). This is what you want to configure the trust relationship with.

If your build uses a reusable workflow, then job_workflow_ref will point at the resuable workflow (e.g. some-framework/default-builder). You almost certainly don't want to base the trust relationship on this, because many people are likely to use that reusable workflow, and their builds will have the same value for the job_workflow_ref, making it not very distinguishing.

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Will!

@steiza steiza merged commit d7f3007 into ossf:main May 19, 2025
1 check passed
@woodruffw woodruffw deleted the ww/workflow-ref branch May 19, 2025 18:10
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