Skip to content

Commit 9a0335a

Browse files
Copilotmikefarah
andauthored
fix: restrict GitHub Actions workflow token permissions (OSSF least-privilege) (#2662)
* Initial plan * fix: add least-privilege token permissions to GitHub workflows (OSSF) Agent-Logs-Url: https://github.com/mikefarah/yq/sessions/1b5db5e2-af78-4289-a6e0-2e972fc68ef1 Co-authored-by: mikefarah <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mikefarah <[email protected]>
1 parent 838c516 commit 9a0335a

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ on:
2020
schedule:
2121
- cron: '24 3 * * 1'
2222

23+
permissions: {}
24+
2325
jobs:
2426
analyze:
2527
name: Analyze

.github/workflows/docker-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
publishDocker:
1214
environment: dockerhub
1315
env:
1416
IMAGE_NAME: mikefarah/yq
1517
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
1621
steps:
1722
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1823

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
- 'v4.*'
66
- 'draft-*'
77

8+
permissions: {}
9+
810
jobs:
911
publishGitRelease:
1012
runs-on: ubuntu-latest

.github/workflows/snap-release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ on:
77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
buildSnap:
1214
environment: snap
1315
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
1418
steps:
1519
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1620
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0

0 commit comments

Comments
 (0)