Workflow GITHUB_TOKEN
not authorised to download packages from GitHub registry
#46641
-
Select Topic AreaQuestion BodyFollowing this documentation, I'm using the default When using a PAT (a secret named What am I missing? Thank you. Here is my repository settings (
Here is a test workflow (link here): name: Test Token
on:
workflow_dispatch:
jobs:
# Fail
github:
name: Test GitHub Token
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Success
pat:
name: Test PAT
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }} |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
Hi @benjamin-guibert, have you resolved your issue? I have run into the same issue. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid it is not possible to download other repositories using the
Even if there were a method to modify the permissions for the |
Beta Was this translation helpful? Give feedback.
-
Thanks @dumitrux and @benjamin-guibert to share your experience and thoughts.
This design seems weird, if a company has lots of private packages published on GitHub, then the actions of the repo in same orgs, installing these packages will cost the data transfer and company have to pay it? |
Beta Was this translation helpful? Give feedback.
-
just let you know that it works on my side right now. |
Beta Was this translation helpful? Give feedback.
-
I found one way, at least it works for me: repo A uses secrets.GITHUB_TOKEN to publish image, repo B uses secrets.GITHUB_TOKEN to pull docker image from repo A. What I did:
hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I was able to download GitHub npm registry by
name: Node.js Package
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
# write your github npm scope
scope: '@example'
- run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Beta Was this translation helpful? Give feedback.
I found one way, at least it works for me:
I have 2 private repos.
repo A publishes a docker image into ghcr.io, repo B uses the docker image for ci.
Billing plan is free.
repo A uses secrets.GITHUB_TOKEN to publish image, repo B uses secrets.GITHUB_TOKEN to pull docker image from repo A.
What I did:
in repo A, publish image with action by following:
ref: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action
in
Manage Actions access
setting page of the package of repo A, pick repo B to have read accessThe url has the format:
(for org user) https://github.…