Skip to content

Commit 00d80d4

Browse files
committed
Add trusted publishing workflow and pin action refs
- Add push_gem.yml for RubyGems trusted publishing on v* tags - Add dependabot.yml for automated GitHub Actions updates - Pin all action refs to commit SHAs in ci.yml and push_gem.yml
1 parent 8357286 commit 00d80d4

3 files changed

Lines changed: 57 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
- "3.4"
2626
- ruby
2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929

3030
- name: Set up Ruby
31-
uses: ruby/setup-ruby@v1
31+
uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
3232
with:
3333
ruby-version: ${{ matrix.ruby }}
3434
bundler-cache: true

.github/workflows/push_gem.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish gem to rubygems.org
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
push:
13+
if: github.repository == "huginn/huginn_agent"
14+
runs-on: ubuntu-latest
15+
16+
environment:
17+
name: rubygems.org
18+
url: https://rubygems.org/gems/huginn_agent
19+
20+
permissions:
21+
contents: write
22+
id-token: write
23+
24+
steps:
25+
- name: Harden Runner
26+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
27+
with:
28+
egress-policy: audit
29+
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
34+
with:
35+
ruby-version: ruby
36+
37+
- name: Publish to RubyGems
38+
uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
39+
40+
- name: Create GitHub release
41+
run: |
42+
tag_name="$(git describe --tags --abbrev=0)"
43+
gh release create "${tag_name}" --verify-tag --generate-notes
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)