1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

chore: Set permissions for GitHub actions

Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
naveen 2022-06-28 00:29:16 +00:00
parent d6624c500a
commit bd50c4e7b0
3 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,9 @@
name: Run unit tests
on: [push, pull_request]
permissions:
contents: read
jobs:
lint:
name: Check PHP syntax
@ -42,6 +45,8 @@ jobs:
- run: |
git ls-files | grep \\\.php$ | grep -v ^dictionaries/scripts/* | ./vendor/bin/parallel-lint --stdin
chunk-matrix:
permissions:
contents: none
name: Generate Chunk Matrix
runs-on: ubuntu-latest

View File

@ -2,6 +2,9 @@ name: Run Shepherd
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest

View File

@ -2,8 +2,13 @@ name: Run unit tests on Windows
on: [push, pull_request]
permissions:
contents: read
jobs:
chunk-matrix:
permissions:
contents: none
name: Generate Chunk Matrix
runs-on: ubuntu-latest