[QUESTION] Trusted Publishing with re-usable GitHub Workflows
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 711
- Forks
- 4.2k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 3
Description
Hey everyone!
I have a question regarding Trusted Publishers that from reading the docs doesn't seem very clear to me.
We have some repositories that have multiple GitHub actions for publishing packages to npm, one to dev tag, one to next, one to latest (and a few others). These workflows all consume a re-usable workflow, where the call to npm publish actually takes place.
Per the last paragraph in Troubleshooting section
Some GitHub Actions workflows use
workflow_callto invoke other workflows that run npm publish, or useworkflow_dispatchfor manual publishing. When this happens, validation checks the calling workflow's name instead of the workflow that actually contains the publish command, which can cause configuration mismatches.
So I am confused as to how can we use trusted publishing when we have a setup like:
workflow_a.ymlworkflow_b.ymlworkflow_c.yml
That all call workflow_reusable.yml (workflow_call), without changing the setup of the workflows?
So far I've been only able to get it working if I set the GitHub Workflow file in npm settings as one of the specific a,b,c workflows, and paste the reusable code inside the calling workflow.
Would I need to always use a single Github Actions workflow file to enable trusted publishing?
Let me know if you need me to clarify anything.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the Trusted Publishers troubleshooting section linked in the issue, then compare its guidance with the workflow_a.yml, workflow_b.yml, workflow_c.yml, and workflow_reusable.yml setup described. Clarify the supported reusable-workflow configuration and document what users must configure or change for trusted publishing to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100