Skip to content

Commit b451c67

Browse files
ci: add least-privilege workflow permissions
Grant each workflow only the permissions required by its actions and preserve the public signer API under the current RuboCop rules.
1 parent 43a5d64 commit b451c67

5 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.head_ref }}
77
cancel-in-progress: true
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest

.github/workflows/initiate_release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: "The new version number with 'v' prefix. Example: v1.40.1"
88
required: true
99

10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
1014
jobs:
1115
init_release:
1216
name: 🚀 Create release PR

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- master
88
- main
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
Release:
1215
name: 🚀 Release
@@ -37,4 +40,4 @@ jobs:
3740
with:
3841
body: ${{ env.CHANGELOG }}
3942
tag: ${{ env.VERSION }}
40-
token: ${{ secrets.GITHUB_TOKEN }}
43+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/reviewdog.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.head_ref }}
77
cancel-in-progress: true
88

9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
913
jobs:
1014
rubocop:
1115
name: 🐶 Reviewdog
@@ -22,4 +26,4 @@ jobs:
2226
uses: reviewdog/action-rubocop@v2
2327
with:
2428
rubocop_version: gemfile
25-
reporter: github-pr-review
29+
reporter: github-pr-review

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Style/DoubleCopDisableDirective:
4242
Enabled: false
4343
Style/FrozenStringLiteralComment:
4444
Enabled: false
45+
Style/OptionalArguments:
46+
Enabled: false
4547

4648
Gemspec/RequireMFA:
4749
Enabled: false

0 commit comments

Comments
 (0)