Skip to content

Commit c7d9484

Browse files
committed
ci: scope permissions to jobs and disable credential persistence
1 parent 3842378 commit c7d9484

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ on:
1515
branches:
1616
- '*'
1717

18+
permissions: {}
19+
1820
jobs:
1921
rubocop:
2022
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
2125
steps:
2226
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
27+
with:
28+
persist-credentials: false
2329
- run: rm Gemfile.lock
2430
- uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # zizmor: ignore[cache-poisoning] -- cached gems are used for testing, not release artifact generation # v1.316.0
2531
with:
@@ -30,6 +36,8 @@ jobs:
3036
lint-actions:
3137
name: GitHub Actions audit
3238
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
3341

3442
steps:
3543
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -50,8 +58,12 @@ jobs:
5058
matrix:
5159
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4", "4.0", "ruby-head", "truffleruby-head", "jruby-9.4", "jruby-10.0", "jruby-head"]
5260
runs-on: ubuntu-latest
61+
permissions:
62+
contents: read
5363
steps:
5464
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
65+
with:
66+
persist-credentials: false
5567
- run: rm Gemfile.lock
5668
- uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # zizmor: ignore[cache-poisoning] -- cached gems are used for testing, not release artifact generation # v1.316.0
5769
with:
@@ -61,8 +73,12 @@ jobs:
6173

6274
cruby-nokogiri-system-libraries:
6375
runs-on: ubuntu-latest
76+
permissions:
77+
contents: read
6478
steps:
6579
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
80+
with:
81+
persist-credentials: false
6682
- run: rm Gemfile.lock
6783
- uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
6884
with:

0 commit comments

Comments
 (0)