]> 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)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 2 Jul 2022 21:59:24 +0000 (23:59 +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>
(cherry picked from commit a8af28c99431fb62243f025cdea18099dde0c844)

.github/workflows/run-on-pr.yaml
.github/workflows/run-test.yaml

index 2a04a1f0485b14e1530b3edb31606722e54f1e52..352eec3abbf9a3147a437a1eac47702b3a1c9cff 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 81b6799e1b23271cbc4dd9a1c1d06fb5282ef96f..36dfce250d209f387420262daec585c78d680f40 100644 (file)
@@ -16,6 +16,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 }}