Added permissions for GitHub actions (#3804)

- 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: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
This commit is contained in:
neilnaveen 2022-04-08 08:44:43 -05:00 committed by GitHub
parent cc0f7a914a
commit 1479e696c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,9 @@ on:
env:
NODE_VERSION: 14.x
permissions:
contents: read
jobs:
build:
name: Build project

View File

@ -27,6 +27,9 @@ on:
env:
PYTHON_VERSION: 3.x
permissions:
contents: read
jobs:
documentation:
name: Build documentation

View File

@ -27,6 +27,9 @@ on:
env:
PYTHON_VERSION: 3.x
permissions:
contents: read
jobs:
publish_pypi:
name: Build and push Python package