Skip to content

Commit ea26a42

Browse files
fix(security): AI Fix for Overly Broad Permissions in GitHub Actions Workflows is risky (#301)
This patch mitigates excessive workflow-level permissions in `.github/workflows/ci.yml` and `.github/workflows/publish.yml` by replacing workflow-level permission grants with empty permissions blocks and re-granting only the minimum required scopes (`contents: read` and `packages: write`) at the job level where they are actually needed. Aikido used AI to generate this PR. Low confidence: Aikido has tested similar fixes, which indicate the correct approach but may be incomplete. Further validation is necessary. Co-authored-by: aikido-autofix[bot] <119856028+aikido-autofix[bot]@users.noreply.github.com>
1 parent e0efa0d commit ea26a42

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55
branches: [main]
66
workflow_dispatch:
77

8-
permissions:
9-
packages: write
8+
permissions: {}
109

1110
jobs:
1211
build:
1312
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
1416

1517
env:
1618
DOTNET_NOLOGO: true

‎.github/workflows/publish.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ name: Publish
33
on:
44
workflow_dispatch:
55

6-
permissions:
7-
packages: write
6+
permissions: {}
87

98
jobs:
109
build:
1110
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
1214

1315
env:
1416
DOTNET_NOLOGO: true

0 commit comments

Comments
 (0)