Skip to content

fix: move nuget publish into a local job using the nuget-publish action - #170

Merged
andregoepel merged 1 commit into
mainfrom
feature/nuget-publish-composite-action
Jul 27, 2026
Merged

fix: move nuget publish into a local job using the nuget-publish action#170
andregoepel merged 1 commit into
mainfrom
feature/nuget-publish-composite-action

Conversation

@andregoepel

Copy link
Copy Markdown
Owner

Problem

The v1.10.0 tag's pack-and-publish job (inside ci-library.yml) failed with Token exchange failed (HTTP 401). Root cause: NuGet.org Trusted Publishing validates the OIDC token's job_workflow_ref against the workflow that defines the running job - for a job inside a called workflow_call workflow, that's the called workflow (andregoepel/workflows), never this repo. A trusted-publishing policy scoped to andregoepel/app-foundation can therefore never match, regardless of nuget.org config. Confirmed structural limitation, see andregoepel/workflows#5.

Fix

Moved pack/login/push into a local pack-and-publish job (defined directly in this repo's ci.yml) that calls the new andregoepel/workflows/.github/actions/nuget-publish@main composite action. Composite actions run as steps inside the caller's own job, so job_workflow_ref stays correctly scoped to this repo.

Test plan

  • ci job (build-and-test) green on this PR
  • Once merged, move the v1.10.0 tag to the fixed commit and confirm the tag-triggered pack-and-publish job succeeds end-to-end (all 6 packages pushed)

ci-library.yml's pack-and-publish job could never satisfy a nuget.org
trusted-publishing policy scoped to this repo, since job_workflow_ref for a
job inside a called workflow_call workflow always points at the called
workflow, not the caller. See andregoepel/workflows#5.
@andregoepel
andregoepel merged commit 9ed87bd into main Jul 27, 2026
4 checks passed
@andregoepel
andregoepel deleted the feature/nuget-publish-composite-action branch July 27, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant