Skip to content

Commit dfbdd1a

Browse files
Copilotdiberry
andcommitted
Add explicit permissions to workflows following principle of least privilege
Co-authored-by: diberry <[email protected]>
1 parent ac687f2 commit dfbdd1a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ on:
77
branches: [ main ]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
build:
1215
name: Build and Test
1316
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1419

1520
steps:
1621
- name: Checkout repository

.github/workflows/validate-workflows.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ on:
1212
# Run weekly on Monday at 9:00 AM UTC to check for outdated actions
1313
- cron: '0 9 * * 1'
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
validate-workflows:
1720
name: Validate Workflow Files
1821
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
1924

2025
steps:
2126
- name: Checkout repository
@@ -44,6 +49,8 @@ jobs:
4449
detect-outdated-actions:
4550
name: Detect Outdated Actions
4651
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
4754

4855
steps:
4956
- name: Checkout repository
@@ -196,6 +203,8 @@ jobs:
196203
runs-on: ubuntu-latest
197204
needs: [validate-workflows, detect-outdated-actions]
198205
if: always()
206+
permissions:
207+
contents: read
199208

200209
steps:
201210
- name: Create summary

0 commit comments

Comments
 (0)