Skip to content

Commit 1d45ca5

Browse files
sashashuracmb69
authored andcommitted
Harden GitHub Workflows security
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz> Closes GH-9440.
1 parent a1b23be commit 1d45ca5

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

.github/workflows/close-needs-feedback.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
schedule:
55
- cron: "0 0 * * *"
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
if: github.repository_owner == 'php'
1013
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
1117
steps:
1218
- name: Close old issues that need feedback
1319
uses: dwieeb/needs-reply@v2

.github/workflows/close-stale-feature-requests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
schedule:
55
- cron: "0 0 * * *"
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
stale:
912
if: github.repository_owner == 'php'
1013
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
1117
steps:
1218
- uses: actions/stale@v4
1319
with:

.github/workflows/close-stale-prs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
schedule:
55
- cron: "0 0 * * *"
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
stale:
912
if: github.repository_owner == 'php'
1013
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
1117
steps:
1218
- uses: actions/stale@v4
1319
with:

.github/workflows/nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
schedule:
44
- cron: "0 1 * * *"
55
workflow_dispatch: ~
6+
permissions:
7+
contents: read
68
jobs:
79
GENERATE_MATRIX:
810
name: Generate Matrix

.github/workflows/push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
pull_request:
1818
branches:
1919
- '**'
20+
permissions:
21+
contents: read
2022
jobs:
2123
LINUX_X64:
2224
strategy:

.github/workflows/remove-needs-feedback.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ on:
55
types:
66
- created
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
if: "github.repository_owner == 'php' && contains(github.event.issue.labels.*.name, 'Status: Needs Feedback') && github.event.issue.user.login == github.event.sender.login"
1114
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1218
steps:
1319
- uses: actions-ecosystem/action-remove-labels@v1
1420
with:

0 commit comments

Comments
 (0)