Skip to content

Commit

Permalink
Harden GitHub Workflows security
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>

Closes GH-9440.
  • Loading branch information
sashashura authored and cmb69 committed Aug 30, 2022
1 parent a1b23be commit 1d45ca5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/close-needs-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
build:
if: github.repository_owner == 'php'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Close old issues that need feedback
uses: dwieeb/needs-reply@v2
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/close-stale-feature-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
stale:
if: github.repository_owner == 'php'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v4
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/close-stale-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ on:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
stale:
if: github.repository_owner == 'php'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch: ~
permissions:
contents: read
jobs:
GENERATE_MATRIX:
name: Generate Matrix
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
pull_request:
branches:
- '**'
permissions:
contents: read
jobs:
LINUX_X64:
strategy:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/remove-needs-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ on:
types:
- created

permissions:
contents: read

jobs:
build:
if: "github.repository_owner == 'php' && contains(github.event.issue.labels.*.name, 'Status: Needs Feedback') && github.event.issue.user.login == github.event.sender.login"
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
Expand Down

0 comments on commit 1d45ca5

Please sign in to comment.