]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
chore: Set permissions for GitHub actions (#8117)
authorNaveen <172697+naveensrinivasan@users.noreply.github.com>
Sat, 2 Jul 2022 21:58:16 +0000 (16:58 -0500)
committerGitHub <noreply@github.com>
Sat, 2 Jul 2022 21:58:16 +0000 (23:58 +0200)
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>
.github/workflows/run-on-pr.yaml
.github/workflows/run-test.yaml

index 45f62d772c654cb2a832c41df6cdc79a01a82519..a1d65fb33fe07bd70da4d3816a2b66066e2f686b 100644 (file)
@@ -12,6 +12,9 @@ env:
   # global env to all steps
   TOX_WORKERS: -n2
 
+permissions:
+  contents: read
+
 jobs:
   run-test-amd64:
     name: ${{ matrix.python-version }}-${{ matrix.build-type }}-${{ matrix.architecture }}-${{ matrix.os }}
index 44c6574bc84cf9596f8a4b7a70015486e8bb8993..40edc574a78ec56f478e1371820b4a2cdfbdd445 100644 (file)
@@ -15,6 +15,9 @@ env:
   # global env to all steps
   TOX_WORKERS: -n2
 
+permissions:
+  contents: read
+
 jobs:
   run-test:
     name: ${{ matrix.python-version }}-${{ matrix.build-type }}-${{ matrix.architecture }}-${{ matrix.os }}