Skip to content

Commit 80c8964

Browse files
committed
📦 Update workflow with configure_trusted_publisher
I ran `configure_trusted_publisher` to regenerate and configure trusted publishing, and copied over most of what it created. The only significant difference is that it adds `step-security/harden-runner`. The other changes are minor: renaming the workflow file and the GitHub environment, using SHA1 checksums for the actions rather than tags, etc. `configure_trusted_publisher` originally configured the trusted publisher on rubygems.org _without_ any reference to the GitHub environment. But then I made the following PR: rubygems/configure_trusted_publisher#9, and used that to generate a new RubyGems Trusted Publisher config.
1 parent 21ab214 commit 80c8964

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/release-gem.yml renamed to .github/workflows/push_gem.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,42 @@ name: Publish gem to rubygems.org
33
on:
44
push:
55
tags:
6-
- v*
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
710

811
jobs:
912
push:
1013
if: github.repository == 'ruby/net-imap'
1114
runs-on: ubuntu-latest
1215

13-
permissions:
14-
id-token: write # mandatory for trusted publishing
15-
contents: write # required for `rake release` to push the release tag
16-
1716
environment:
18-
name: RubyGems
17+
name: rubygems.org
1918
url: https://rubygems.org/gems/net-imap
2019

20+
permissions:
21+
contents: write
22+
id-token: write
23+
2124
steps:
22-
- uses: actions/checkout@v4
25+
# Set up
26+
- name: Harden Runner
27+
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
28+
with:
29+
egress-policy: audit
30+
31+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2332

2433
- name: Set up Ruby
25-
uses: ruby/setup-ruby@v1
34+
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
2635
with:
2736
bundler-cache: true
28-
ruby-version: 3.2
37+
ruby-version: ruby
2938

39+
# Release
3040
- name: Publish to RubyGems
31-
uses: rubygems/release-gem@v1
41+
uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31 # v1
3242

3343
- name: Create GitHub release
3444
run: |

0 commit comments

Comments
 (0)