Skip to content

Commit 49ab9c2

Browse files
committed
ci: set explicit strict permissions
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
1 parent aded4b6 commit 49ab9c2

5 files changed

Lines changed: 43 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
push:
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
test:
1013
name: Test
@@ -26,6 +29,7 @@ jobs:
2629
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2730
with:
2831
repository: ScoopInstaller/Scoop
32+
ref: 'develop'
2933
path: 'scoop_core'
3034
- name: Install and cache test dependencies
3135
uses: potatoqualitee/psmodulecache@ee5e9494714abf56f6efbfa51527b2aec5c761b8 # v6.2.1

.github/workflows/excavator.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1+
name: Excavator
2+
13
on:
24
workflow_dispatch:
35
schedule:
46
- cron: '0 */4 * * *'
5-
name: Excavator
7+
8+
permissions:
9+
contents: write
10+
611
jobs:
712
excavate:
813
name: Excavate
914
runs-on: windows-latest
1015
steps:
11-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1218
- name: Excavate
1319
uses: ScoopInstaller/GithubActions@main
1420
env:
1521
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1622
SKIP_UPDATED: '1'
23+
SCOOP_BRANCH: develop
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1+
name: Commented Pull Request
2+
13
on:
24
issue_comment:
35
types: [ created ]
4-
name: Commented Pull Request
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
511
jobs:
612
pullRequestHandler:
713
name: PullRequestHandler
814
runs-on: windows-latest
915
steps:
10-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1118
- name: PullRequestHandler
1219
uses: ScoopInstaller/GithubActions@main
1320
if: startsWith(github.event.comment.body, '/verify')
1421
env:
1522
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
SCOOP_BRANCH: develop

.github/workflows/issues.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1+
name: Issues
2+
13
on:
24
issues:
35
types: [ opened, labeled ]
4-
name: Issues
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
511
jobs:
612
issueHandler:
713
name: IssueHandler
814
runs-on: windows-latest
915
steps:
10-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1118
- name: IssueHandler
1219
uses: ScoopInstaller/GithubActions@main
1320
if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))
1421
env:
1522
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
SCOOP_BRANCH: develop

.github/workflows/pull_request.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
name: Pull Requests
2+
13
on:
24
pull_request:
35
types: [ opened ]
4-
name: Pull Requests
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
511
jobs:
612
pullRequestHandler:
713
name: PullRequestHandler
814
runs-on: windows-latest
915
steps:
10-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Checkout
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1118
- name: PullRequestHandler
1219
uses: ScoopInstaller/GithubActions@main
1320
env:
1421
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
SCOOP_BRANCH: develop

0 commit comments

Comments
 (0)