Set permissions for GitHub actions

- 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/)

 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.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
This commit is contained in:
naveensrinivasan 2022-04-06 20:35:46 +00:00
parent 95e982b3f2
commit e0aa749b62
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,11 @@ on:
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
test:
permissions:
contents: none
uses: fog/.github/.github/workflows/ruby.yml@v1.1.0

View File

@ -4,6 +4,11 @@ on:
schedule:
- cron: "30 1 * * *"
permissions:
contents: read
jobs:
stale:
permissions:
contents: none
uses: fog/.github/.github/workflows/stale.yml@v1.1.0