fix: move nuget publish into a local job using the nuget-publish action - #170
Merged
Merged
Conversation
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.
This was referenced Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The v1.10.0 tag's
pack-and-publishjob (insideci-library.yml) failed withToken exchange failed (HTTP 401). Root cause: NuGet.org Trusted Publishing validates the OIDC token'sjob_workflow_refagainst the workflow that defines the running job - for a job inside a calledworkflow_callworkflow, that's the called workflow (andregoepel/workflows), never this repo. A trusted-publishing policy scoped toandregoepel/app-foundationcan 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-publishjob (defined directly in this repo'sci.yml) that calls the newandregoepel/workflows/.github/actions/nuget-publish@maincomposite action. Composite actions run as steps inside the caller's own job, sojob_workflow_refstays correctly scoped to this repo.Test plan
cijob (build-and-test) green on this PRpack-and-publishjob succeeds end-to-end (all 6 packages pushed)