Skip to content

ci: upgrade devops-templates to v10.0 with NuGet trusted publishing#46

Merged
ncipollina merged 2 commits into
mainfrom
ci/v10-templates
Jun 25, 2026
Merged

ci: upgrade devops-templates to v10.0 with NuGet trusted publishing#46
ncipollina merged 2 commits into
mainfrom
ci/v10-templates

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Summary

Upgrades all workflow references from devops-templates@v8.0 to v10.0 and converts the publish flows to use NuGet Trusted Publishing (OIDC) via the new nuget-push composite action introduced in v10.0.

Changes

publish-preview.yaml and publish-release.yaml

  • Renamed publish job to build — now calls the shared template for version resolution, build, test, pack, and artifact upload only
  • Added push job that uses LayeredCraft/devops-templates/.github/actions/nuget-push@v10.0 to handle OIDC login and NuGet push
  • Replaced permissions: write-all with least-privilege permissions per job

pr-build.yaml

  • Updated to @v10.0
  • Replaced permissions: write-all with contents: read

pr-title-check.yaml and release-drafter.yaml

  • Updated to @v10.0

Validation

  • publish-preview flow validated end-to-end on LayeredCraft/compact-json-formatter with the same template version and composite action
  • OIDC exchange succeeds because the push job runs in the caller's workflow context, making job_workflow_ref match the NuGet trusted publisher policy

Notes for Reviewers

The key architectural reason for splitting build and push into separate jobs: GitHub's OIDC token includes a job_workflow_ref claim set to the workflow file where the job physically runs. When NuGet/login ran inside the shared reusable workflow, the claim pointed to devops-templates — which NuGet.org's trusted publisher policy rejected. Running the push in a composite action (which executes inline in the caller's job) keeps the claim pointed at this repo's workflow file.

NuGet.org trusted publisher policy for this repo will need to be configured to match .github/workflows/publish-preview.yaml and .github/workflows/publish-release.yaml before the push jobs will succeed.

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added the type: ci CI/CD changes label Jun 25, 2026
Only the version tag should have changed, not the permissions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca6c0bfa23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pr-build.yaml Outdated
- main
permissions: write-all
permissions:
contents: read

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Grant the reusable PR build its required permissions

On pull requests, this top-level contents: read is the only permission passed to the reusable job at LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v10.0. I checked that v10 template and it declares permissions: id-token: write and contents: write; GitHub's reusable workflow docs state caller token permissions can only be downgraded, not elevated, so the called workflow is not allowed to request those permissions and the PR build workflow will fail validation/execution instead of running CI. Please grant the required permissions on this calling job/workflow or use a template that does not request them.

Useful? React with 👍 / 👎.

@j-d-ha j-d-ha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ncipollina ncipollina merged commit c269a4b into main Jun 25, 2026
4 checks passed
@ncipollina ncipollina deleted the ci/v10-templates branch June 25, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: ci CI/CD changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants