Skip to content

Commit 6e14d24

Browse files
ci: scope permissions to job level
1 parent f9ccf2f commit 6e14d24

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
name: Jekyll CI
3-
permissions:
4-
contents: read
3+
permissions: {}
54

65
on:
76
pull_request:
@@ -22,6 +21,8 @@ concurrency:
2221
jobs:
2322
call-jekyll-build:
2423
uses: ./.github/workflows/jekyll-build.yml
24+
permissions:
25+
contents: read
2526
secrets:
2627
GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
2728
GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }}

.github/workflows/jekyll-build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
name: Build Jekyll
3-
permissions:
4-
contents: read
3+
permissions: {}
54

65
on:
76
workflow_call:
@@ -71,6 +70,8 @@ env:
7170
jobs:
7271
build:
7372
name: Build Jekyll
73+
permissions:
74+
contents: read
7475
runs-on: ubuntu-latest
7576
steps:
7677
- name: Input validation
@@ -235,8 +236,10 @@ jobs:
235236
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
236237
github.event_name == 'schedule' ||
237238
github.event_name == 'workflow_dispatch'
238-
runs-on: ubuntu-latest
239239
needs: build
240+
permissions:
241+
contents: read
242+
runs-on: ubuntu-latest
240243
steps:
241244
- name: Checkout gh-pages
242245
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

0 commit comments

Comments
 (0)