From: Naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Sat, 2 Jul 2022 21:58:16 +0000 (-0500) Subject: chore: Set permissions for GitHub actions (#8117) X-Git-Tag: rel_1_4_40~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12c55290a3080f22721e4ad8d60f9742e70c04aa;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git chore: Set permissions for GitHub actions (#8117) 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) --- diff --git a/.github/workflows/run-on-pr.yaml b/.github/workflows/run-on-pr.yaml index 2a04a1f048..352eec3abb 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.build-type }}-${{ matrix.architecture }}-${{ matrix.os }} diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 81b6799e1b..36dfce250d 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -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 }}