Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 2, 2025

The npm publish workflow was failing with 401 Bad credentials when calling release-please CLI. The command was not passing a GitHub token required for GraphQL API authentication.

Changes

  • Pass GitHub token to release-please: Changed npm run release to npx release-please release-pr --token=${{ secrets.GITHUB_TOKEN }}
  • Add explicit permissions: Added contents: write and pull-requests: write to the publish-npm job
  • Remove unnecessary git operations: Deleted git push command and redundant push action step since release-please operates via GitHub API, not local git
- name: Create Release PR
  run: |
    git config --local user.email "[email protected]"
    git config --local user.name "GitHub Actions"
    npx release-please release-pr --repo-url=https://github.com/RaviDasari/see-image-diff --token=${{ secrets.GITHUB_TOKEN }}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/142.0.7444.59/linux64/chrome-headless-shell-linux64.zip
    • Triggering command: node install.mjs (http block)
  • https://storage.googleapis.com/chrome-for-testing-public/142.0.7444.59/linux64/chrome-linux64.zip

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Publish npm package is failing with below error HttpError: Bad credentials - https://docs.github.com/graphql at /home/runner/work/see-image-diff/see-image-diff/node_modules/@octokit/request/dist-node/index.js:125:21 ... 7 lines matching cause stack trace ... at async Object.handler (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/bin/release-please.js:360:40) { status: 401, body: { message: 'Bad credentials', documentation_url: 'https://docs.github.com/graphql', status: '401' }, name: 'GitHubAPIError', cause: RequestError [HttpError]: Bad credentials - https://docs.github.com/graphql at /home/runner/work/see-image-diff/see-image-diff/node_modules/@octokit/request/dist-node/index.js:125:21 at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async /home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/github.js:74:38 at async GitHub.graphqlRequest (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/github.js:1255:20) at async GitHub.releaseGraphQL (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/github.js:867:26) at async GitHub.releaseIterator (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/github.js:849:30) at async Manifest.buildPullRequests (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/manifest.js:202:26) at async Manifest.createPullRequests (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/manifest.js:468:39) at async Object.handler (/home/runner/work/see-image-diff/see-image-diff/node_modules/release-please/build/src/bin/release-please.js:360:40) { status: 401, response: { url: 'https://api.github.com/graphql', status: 401, headers: [Object], data: [Object] }, request: { method: 'POST', url: 'https://api.github.com/graphql', headers: [Object], body: '{"query":"query releases($owner: String!, $repo: String!, $num: Int!, $cursor: String) {\\n repository(owner: $owner, name: $repo) {\\n releases(first: $num, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {\\n nodes {\\n name\\n tag {\\n name\\n }\\n tagCommit {\\n oid\\n }\\n url\\n description\\n isDraft\\n }\\n pageInfo {\\n endCursor\\n hasNextPage\\n }\\n }\\n }\\n }","variables":{"owner":"RaviDasari","repo":"see-image-diff","num":25}}', request: [Object] } } } Error: Process completed with exit code 1.. Can you check and see what is going on?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 2, 2025
Copilot AI changed the title [WIP] Fix bad credentials error during npm package publish Fix release-please authentication failure in npm publish workflow Nov 2, 2025
Copilot AI requested a review from RaviDasari November 2, 2025 01:47
@RaviDasari RaviDasari marked this pull request as ready for review November 2, 2025 01:49
@RaviDasari RaviDasari merged commit b634ee7 into master Nov 2, 2025
3 checks passed
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.

2 participants