Skip to content

Commit 3276a0d

Browse files
CopilotMaStr
authored andcommitted
fix: add explicit permissions blocks to GitHub Actions workflows
Fixes CodeQL alerts #1, #2, #5, #50 (actions/missing-workflow-permissions). Adds 'permissions: contents: read' to each job to restrict GITHUB_TOKEN scope and follow the principle of least privilege.
1 parent f5390ed commit 3276a0d

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
build:
1616
runs-on: ubuntu-latest
1717
#runs-on: self-hosted
18+
permissions:
19+
contents: read
1820
strategy:
1921
fail-fast: false
2022
matrix:
@@ -74,6 +76,8 @@ jobs:
7476
merge:
7577
runs-on: ubuntu-latest
7678
#runs-on: self-hosted
79+
permissions:
80+
contents: read
7781
needs:
7882
- build
7983
steps:

.github/workflows/pylint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
lint:
1818
#runs-on: self-hosted
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
strategy:
2123
matrix:
2224
python-version: ["3.9", "3.10" , "3.11" , "3.12", "3.13"]

.github/workflows/pytest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1214
strategy:
1315
fail-fast: false
1416
matrix:

0 commit comments

Comments
 (0)