]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
chore: Set permissions for GitHub actions (#1035)
authornathannaveen <42319948+nathannaveen@users.noreply.github.com>
Sat, 4 Jun 2022 09:10:22 +0000 (04:10 -0500)
committerGitHub <noreply@github.com>
Sat, 4 Jun 2022 09:10:22 +0000 (11:10 +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: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
.github/workflows/run-on-pr.yaml
.github/workflows/run-test.yaml

index e3bc5f29897901d9829a89c425522fca7a7f0471..360a6cf227c509f1641a4b1694075f2a00e3f504 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.sqlalchemy }}-${{ matrix.os }}
index 1f19116db4848ce72da01598219e9bac194f4441..3ff5e510802585a090f4f0471da181061675aa37 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.sqlalchemy }}-${{ matrix.os }}