Skip to content

Commit c63a3e0

Browse files
committed
chore: secure workflows permission
1 parent 487ec6d commit c63a3e0

12 files changed

+49
-0
lines changed

.github/workflows/deploy-apidocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
- 'system/**'
1212
- '.github/workflows/deploy-apidocs.yml'
1313

14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
1418
jobs:
1519
build:
1620
name: Deploy to api

.github/workflows/deploy-distributables.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
check-version:
1111
name: Check for updated version
12+
permissions:
13+
contents: read
1214
runs-on: ubuntu-22.04
1315

1416
steps:
@@ -31,6 +33,10 @@ jobs:
3133
3234
framework:
3335
name: Deploy to framework
36+
permissions:
37+
# Allow actions/github-script to create release
38+
contents: write
39+
pull-requests: write
3440
if: github.repository == 'codeigniter4/CodeIgniter4'
3541
runs-on: ubuntu-22.04
3642
needs: check-version
@@ -78,6 +84,10 @@ jobs:
7884
7985
appstarter:
8086
name: Deploy to appstarter
87+
permissions:
88+
# Allow actions/github-script to create release
89+
contents: write
90+
pull-requests: write
8191
if: github.repository == 'codeigniter4/CodeIgniter4'
8292
runs-on: ubuntu-22.04
8393
needs: check-version
@@ -125,6 +135,10 @@ jobs:
125135
126136
userguide:
127137
name: Deploy to userguide
138+
permissions:
139+
# Allow actions/github-script to create release
140+
contents: write
141+
pull-requests: write
128142
if: github.repository == 'codeigniter4/CodeIgniter4'
129143
runs-on: ubuntu-22.04
130144
needs: check-version

.github/workflows/deploy-userguide-latest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
jobs:
1616
build:
1717
name: Deploy to gh-pages
18+
permissions:
19+
# Allow ad-m/github-push-action to push commit to branch gh-pages
20+
contents: write
21+
pull-requests: write
1822
if: (github.repository == 'codeigniter4/CodeIgniter4')
1923
runs-on: ubuntu-latest
2024
steps:

.github/workflows/test-autoreview.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1919
cancel-in-progress: true
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
auto-review-tests:
2326
uses: ./.github/workflows/reusable-serviceless-phpunit-test.yml # @TODO Extract to codeigniter4/.github repo

.github/workflows/test-coding-standards.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1717
cancel-in-progress: true
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
lint:
2124
name: PHP ${{ matrix.php-version }} Lint with PHP CS Fixer

.github/workflows/test-deptrac.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ concurrency:
2828
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2929
cancel-in-progress: true
3030

31+
permissions:
32+
contents: read
33+
3134
jobs:
3235
build:
3336
name: Architectural Inspection

.github/workflows/test-phpcpd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ concurrency:
2727
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2828
cancel-in-progress: true
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
build:
3235
name: Duplicate Code Detection

.github/workflows/test-phpstan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3232
cancel-in-progress: true
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
build:
3639
name: PHP ${{ matrix.php-versions }} Static Analysis

.github/workflows/test-phpunit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3232
cancel-in-progress: true
3333

34+
permissions:
35+
contents: read
36+
3437
jobs:
3538
# Any environment variables set in an env context defined at the workflow level
3639
# in the caller workflow are not propagated to the called workflow.

.github/workflows/test-rector.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ concurrency:
3333
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3434
cancel-in-progress: true
3535

36+
permissions:
37+
contents: read
38+
3639
jobs:
3740
build:
3841
name: PHP ${{ matrix.php-versions }} Analyze code (Rector) on ${{ matrix.paths }}

0 commit comments

Comments
 (0)