From: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Date: Sat, 4 Jun 2022 09:10:22 +0000 (-0500) Subject: chore: Set permissions for GitHub actions (#1035) X-Git-Tag: rel_1_8_1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dd2cc8ddfb7a48b693c12f20d68964a78912e59;p=thirdparty%2Fsqlalchemy%2Falembic.git chore: Set permissions for GitHub actions (#1035) 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> --- diff --git a/.github/workflows/run-on-pr.yaml b/.github/workflows/run-on-pr.yaml index e3bc5f29..360a6cf2 100644 --- a/.github/workflows/run-on-pr.yaml +++ b/.github/workflows/run-on-pr.yaml @@ -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 }} diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 1f19116d..3ff5e510 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -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 }}