Skip to content

Commit 4510227

Browse files
committed
ci: move workflow permissions to job level
Move 'contents: read' permission from workflow level to individual job level for better clarity and following the principle of least privilege. Each job now explicitly declares its required permissions.
1 parent 5df7687 commit 4510227

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/dotnet.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
name: .NET CI
55

6-
permissions:
7-
contents: read
8-
96
on:
107
push:
118
branches: [ "master" ]
@@ -19,6 +16,8 @@ env:
1916
jobs:
2017
build:
2118
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
2221
steps:
2322
- name: Checkout repository
2423
uses: actions/checkout@v6.0.1
@@ -45,6 +44,8 @@ jobs:
4544
test:
4645
needs: build
4746
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
4849
steps:
4950
- name: Checkout repository
5051
uses: actions/checkout@v6.0.1
@@ -79,6 +80,8 @@ jobs:
7980
coverage:
8081
needs: test
8182
runs-on: ubuntu-latest
83+
permissions:
84+
contents: read
8285
strategy:
8386
matrix:
8487
service: [codecov, codacy]

0 commit comments

Comments
 (0)