Skip to content

Commit 5cf7786

Browse files
authored
chore: Set permissions to read for GitHub actions (#1546)
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>
1 parent e7103e6 commit 5cf7786

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/release-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on: workflow_dispatch
55
env:
66
DEFAULT_PYTHON: 3.8
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
virtualenv-15-windows-test:
1013
# Regression test added in https://github.com/PyCQA/astroid/pull/1386

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
env:
99
DEFAULT_PYTHON: 3.9
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
release-pypi:
1316
name: Upload release to PyPI

0 commit comments

Comments
 (0)