Skip to content

Unauthorized when publishing private Package with Personal Access Token #45097

Answered by Melv
ladooniani asked this question in Packages
Discussion options

You must be logged in to vote

Following Quickstart for GitHub Packages on a private repo I also had that error message.
I've solved it to remove the .npmrc from the repo and build it into the gh actions yaml end let _authToken use the provided secrets.GITHUB_TOKEN.

name: Node.js Package

on:
  release:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - run: npm ci
      - run: npm test


  publish-gpr:
    needs: build
    runs-on: ubuntu-latest
    permissions:
      packages: write
      contents: read
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-n…

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
5 replies
@ladooniani
Comment options

@PythonCoderAS
Comment options

@ladooniani
Comment options

@PythonCoderAS
Comment options

@ladooniani
Comment options

Comment options

You must be logged in to vote
5 replies
@MalvinJay
Comment options

@nikmolnar
Comment options

@ahsan-babar
Comment options

@VishwasShashidhar
Comment options

@mpint
Comment options

Answer selected by Akash1134
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Packages Host your dependencies, libraries, and production-ready code, right from your repository Question
10 participants