You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document reusable workflow support for trusted publishing
Add documentation for the new Workflow Repository Owner and Workflow
Repository Name fields that enable trusted publishing with reusable
workflows from different repositories.
Copy file name to clipboardExpand all lines: trusted-publishing/adding-a-publisher.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,30 @@ If you have multiple workflows that push gems, you can create one Trusted Publis
30
30
The environment allows GitHub to constrain who can publish your gem if many people have access to the repository.
31
31
We suggest using the [GitHub Action Environment](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/using-environments-for-deploymentenvironment) name "release", which we will use in our workflow examples on the next page.
32
32
33
+
### Using reusable workflows
34
+
35
+
If your release workflow uses a [reusable workflow](https://docs.github.com/en/actions/sharing-automations/reusing-workflows) from a different repository, you'll need to configure the optional "Workflow Repository" fields.
36
+
37
+
When a workflow calls a reusable workflow from another repository, the OIDC token's `job_workflow_ref` claim points to the reusable workflow's location, not the calling repository's workflow. The "Workflow Repository Owner" and "Workflow Repository Name" fields tell RubyGems.org where the actual workflow file lives.
38
+
39
+
For example, if your gem's repository (`my-org/my-gem`) calls a shared release workflow from `shared-org/shared-workflows`:
Copy file name to clipboardExpand all lines: trusted-publishing/pushing-a-new-gem.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ For example, if you have a repository at `https://github.com/rubygems/sample-gem
29
29
30
30
{:class="t-img"}
31
31
32
+
If your workflow uses a reusable workflow from another repository, you'll also need to fill in the optional "Workflow Repository Owner" and "Workflow Repository Name" fields. See [Using reusable workflows](/trusted-publishing/adding-a-publisher#using-reusable-workflows) for details.
33
+
32
34
Once you click "Create Pending trusted publisher", your publisher will be registered and will appear in the list of pending publishers for your account.
33
35
34
36
{:class="t-img"}
0 commit comments