Skip to content

Commit c269a4b

Browse files
ncipollinaclaude
andauthored
ci: upgrade devops-templates to v10.0 with NuGet trusted publishing (#46)
* ci: upgrade devops-templates to v10.0 with NuGet trusted publishing Split publish jobs into build (shared template) and push (composite action) so the OIDC job_workflow_ref matches the NuGet trusted publisher policy. Tightens permissions from write-all to least privilege. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ci): restore pr-build.yaml permissions to write-all Only the version tag should have changed, not the permissions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b36eeb5 commit c269a4b

5 files changed

Lines changed: 36 additions & 11 deletions

File tree

.github/workflows/pr-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
permissions: write-all
88
jobs:
99
build:
10-
uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v8.0
10+
uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v10.0
1111
with:
1212
solution: LayeredCraft.StructuredLogging.slnx
1313
hasTests: true

.github/workflows/pr-title-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ permissions:
1010

1111
jobs:
1212
validate:
13-
uses: LayeredCraft/devops-templates/.github/workflows/pr-title-check.yml@v8.0
13+
uses: LayeredCraft/devops-templates/.github/workflows/pr-title-check.yml@v10.0

.github/workflows/publish-preview.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
branches:
77
- main
88

9-
permissions: write-all
9+
permissions:
10+
contents: write
11+
pull-requests: write
1012

1113
jobs:
12-
publish:
13-
uses: LayeredCraft/devops-templates/.github/workflows/publish-preview.yml@v8.0
14+
build:
15+
uses: LayeredCraft/devops-templates/.github/workflows/publish-preview.yml@v10.0
1416
with:
1517
solution: LayeredCraft.StructuredLogging.slnx
1618
dotnetVersion: |
@@ -19,4 +21,15 @@ jobs:
1921
10.0.x
2022
11.0.x
2123
hasTests: true
22-
secrets: inherit
24+
secrets: inherit
25+
26+
push:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
contents: read
32+
steps:
33+
- uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v10.0
34+
with:
35+
nuget_user: ${{ secrets.NUGET_USER }}

.github/workflows/publish-release.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ on:
44
release:
55
types: [published]
66

7-
permissions: write-all
7+
permissions:
8+
contents: write
89

910
jobs:
10-
publish:
11-
uses: LayeredCraft/devops-templates/.github/workflows/publish-release.yml@v8.0
11+
build:
12+
uses: LayeredCraft/devops-templates/.github/workflows/publish-release.yml@v10.0
1213
with:
1314
solution: LayeredCraft.StructuredLogging.slnx
1415
dotnetVersion: |
@@ -17,4 +18,15 @@ jobs:
1718
10.0.x
1819
11.0.x
1920
hasTests: true
20-
secrets: inherit
21+
secrets: inherit
22+
23+
push:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
permissions:
27+
id-token: write
28+
contents: read
29+
steps:
30+
- uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v10.0
31+
with:
32+
nuget_user: ${{ secrets.NUGET_USER }}

.github/workflows/release-drafter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
draft:
17-
uses: LayeredCraft/devops-templates/.github/workflows/release-drafter.yml@v8.0
17+
uses: LayeredCraft/devops-templates/.github/workflows/release-drafter.yml@v10.0
1818
with:
1919
event_name: ${{ github.event_name }}
2020
pr_draft: ${{ github.event.pull_request.draft == true }}

0 commit comments

Comments
 (0)