Skip to content

ci: reshape publish.yaml to inline composite action (pinned @v1) for trusted publishing - #2

Merged
peaceful-bot merged 3 commits into
mainfrom
fix/trusted-publishing-id-token
Jun 11, 2026
Merged

ci: reshape publish.yaml to inline composite action (pinned @v1) for trusted publishing#2
peaceful-bot merged 3 commits into
mainfrom
fix/trusted-publishing-id-token

Conversation

@monsieurleberre

@monsieurleberre monsieurleberre commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why

nuget.org Trusted Publishing validates the OIDC job_workflow_ref claim, and the policy is anchored on peacefulstudio/dotnet-extensions/.github/workflows/publish.yaml. The previous publish.yaml called a reusable workflow (jobs.publish.uses: .../csharp-publish-public.yaml@v1), which runs the job in the github-actions repo and stamps job_workflow_ref as github-actions/... -> live HTTP 401 on push.

What changed (only publish.yaml)

  • publish is now a normal job (no jobs.publish.uses:), so the job runs in this repo and job_workflow_ref resolves to dotnet-extensions/.github/workflows/publish.yaml.
  • NuGet/login runs in this job with id-token: write, minting the short-lived key here so the token carries the correct job_workflow_ref.
  • The build/test/pack/push heavy lifting moves to a composite action invoked as an inline steps: - uses: step. A composite action does not change job_workflow_ref. The caller passes the short-lived key in via api-key; the composite does NOT do its own login.

Composite action ref

Now pinned to the stable release:

peacefulstudio/github-actions/.github/actions/csharp-publish@v1

v1 of peacefulstudio/github-actions has been advanced to include the csharp-publish composite action. The earlier 0.2.1-preview.2 test publish already validated this path end-to-end against the feature branch; this PR simply repoints the same flow at the stable tag.

Notes

  • This is a CI-only change -> no changelog entry.
  • .github/ changes require a human maintainer to merge.

Copilot AI review requested due to automatic review settings June 11, 2026 14:32

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@monsieurleberre monsieurleberre changed the title ci: grant id-token: write for NuGet trusted publishing ci: reshape publish.yaml to inline composite action for trusted publishing Jun 11, 2026
Copilot AI review requested due to automatic review settings June 11, 2026 16:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@monsieurleberre monsieurleberre changed the title ci: reshape publish.yaml to inline composite action for trusted publishing ci: reshape publish.yaml to inline composite action (pinned @v1) for trusted publishing Jun 11, 2026
@monsieurleberre
monsieurleberre enabled auto-merge (squash) June 11, 2026 17:04
@monsieurleberre
monsieurleberre disabled auto-merge June 11, 2026 17:18
The shared csharp-publish-public.yaml@v1 now mints a short-lived
nuget.org key via OIDC (NuGet/login). The calling job must grant
id-token: write or the OIDC token request fails.
…shing

Mint the OIDC token in this publish.yaml job via NuGet/login with
id-token: write, so job_workflow_ref resolves to
dotnet-extensions/.github/workflows/publish.yaml (the nuget.org
Trusted Publishing policy anchor). The heavy lifting moves to the
csharp-publish composite action invoked as an inline step, which does
not change job_workflow_ref.
@monsieurleberre
monsieurleberre force-pushed the fix/trusted-publishing-id-token branch from 408aaad to b7256b8 Compare June 11, 2026 17:21
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Peaceful.Extensions.Hosting 100% 95% 24
Peaceful.Extensions.Telemetry 96% 95% 22
Peaceful.Extensions.Logging 99% 97% 33
Summary 99% (291 / 295) 96% (71 / 74) 79

@peaceful-bot
peaceful-bot merged commit 45f4568 into main Jun 11, 2026
1 check passed
@peaceful-bot
peaceful-bot deleted the fix/trusted-publishing-id-token branch June 11, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants