[BUG] use `pull_request_target` trigger OIDC publish failing from GitHub actions
Open
Nobody has claimed this yet.
Bug
Needs Triage
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
name: "Publish Dev Preview on PR Merge"
on:
pull_request_target:
types: [closed]
paths:
- "packages/**"
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
jobs:
npm-preview:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: yarn
- name: Install and build
.....
- name: npm publish
run: npm publish --tag latest --provenance --access public
Expected Behavior
Steps To Reproduce
When I changed pull_request_target to push, it was successfully triggered.
Environment
use github action ci
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
Start with the shown GitHub Actions workflow, especially the pull_request_target trigger, actions/setup-node@v4, and npm publish --provenance step. Compare the failing trigger with push and inspect the OIDC and provenance requirements; done means a reproducible workflow publishes successfully with the intended trigger.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, javascript, node.js
- Domain
- ci-cd, devops, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100