Skip to content

Commit a9c8d48

Browse files
hsbtclaude
andcommitted
Improve documentation for role-to-assume and add Trusted Publisher section
Clarify that role-to-assume expects an OIDC API Key Role token string (rg_oidc_akr_...) rather than a numeric ID, add documentation for Trusted Publisher as the recommended approach, and update the table of contents to reflect the new structure. Fixes #161 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fb7041d commit a9c8d48

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ and exports environment variables used by both `rubygems` and
1616
<!-- toc -->
1717

1818
- [Usage](#usage)
19-
- [Examples](#examples)
20-
- [OIDC (recommended)](#oidc-recommended)
21-
- [Static API token in repository secrets](#static-api-token-in-repository-secrets)
19+
- [Trusted Publisher (recommended)](#trusted-publisher-recommended)
20+
- [OIDC API Key Role](#oidc-api-key-role)
21+
- [Static API token in repository secrets](#static-api-token-in-repository-secrets)
2222
- [Use with the RubyGems CLI](#use-with-the-rubygems-cli)
2323
- [License Summary](#license-summary)
2424
- [Security Disclosures](#security-disclosures)
@@ -27,11 +27,31 @@ and exports environment variables used by both `rubygems` and
2727

2828
## Usage
2929

30-
We recommend that
31-
you use GitHub's OIDC provider in conjunction with a configured
32-
RubyGems OIDC API Key Role.
30+
There are three ways to configure RubyGems credentials:
3331

34-
To do that, you would add the following step to your workflow:
32+
1. **Trusted Publisher (recommended)**: Uses OIDC without any API tokens or secrets.
33+
2. **OIDC API Key Role**: Uses OIDC with a pre-configured API Key Role on RubyGems.org.
34+
3. **Static API token**: Uses a RubyGems API token stored in repository secrets.
35+
36+
### Trusted Publisher (recommended)
37+
38+
The simplest approach is to use [Trusted Publishing](https://guides.rubygems.org/trusted-publishing/).
39+
Configure a trusted publisher for your gem on RubyGems.org, then use:
40+
41+
```yaml
42+
- name: Configure RubyGems Credentials
43+
uses: rubygems/configure-rubygems-credentials@main
44+
```
45+
46+
No additional inputs are required. The action will automatically use OIDC to authenticate
47+
with RubyGems.org as a trusted publisher.
48+
49+
### OIDC API Key Role
50+
51+
Alternatively, you can create an OIDC API Key Role on RubyGems.org and reference it
52+
with the `role-to-assume` input. The value is the **OIDC API Key Role token**
53+
(a string starting with `rg_oidc_akr_`), which you can find on the
54+
"OIDC: Create" page of your gem on RubyGems.org.
3555

3656
```yaml
3757
- name: Configure RubyGems Credentials
@@ -58,9 +78,7 @@ jobs:
5878
steps:
5979
- uses: rubygems/configure-rubygems-credentials@main
6080
with:
61-
role-to-assume: 2
62-
gem-server: 'https://oidc-api-token.rubygems.org'
63-
audience: 'https://oidc-api-token.rubygems.org'
81+
role-to-assume: rg_oidc_akr_f55fe1127adjkkcn8ty6
6482
- uses: actions/checkout@v3
6583
- name: Set remote URL
6684
run: |
@@ -79,20 +97,7 @@ jobs:
7997
See [action.yml](action.yml) for the full documentation for this action's inputs
8098
and outputs.
8199

82-
### Examples
83-
84-
#### OIDC (recommended)
85-
86-
```yaml
87-
- name: Configure RubyGems Credentials
88-
uses: rubygems/configure-rubygems-credentials@main
89-
with:
90-
role-to-assume: 3
91-
```
92-
93-
In this example, the Action will load the OIDC token from the GitHub-provided environment variable and use it to assume the role `3`.
94-
95-
#### Static API token in repository secrets
100+
### Static API token in repository secrets
96101

97102
```yaml
98103
- name: Configure RubyGems Credentials

0 commit comments

Comments
 (0)