Replies: 20 comments 18 replies
-
|
I hit same issue, I filed: actions/hello-world-docker-action#15 The problem appears to be that the |
Beta Was this translation helpful? Give feedback.
-
|
this is something that gitlab has had working for about a year now and has a positively huge impact on pipeline development. Not only am I running into this exact problem, but it's been well over a year since it's been brought up AND nobody from github has even responded. At this point with all the feature bloat elsewhere and lack of support tooling to make developers jobs easier, I can't justify recommending github as a solution to another development team and could easily justify the hours it would take to migrate to gitlab depending on the size of the account. I'm not mad, just disappointed in the product. It can't even deliver on the basic necessary features that a direct competitor could perform a year ago with what's likely a budget 3/4 the size. |
Beta Was this translation helpful? Give feedback.
-
|
Please fix :) it's super unintuitive, and after some Googling, I see many folks are having the same unauthorized issue on public repos with public images. I'm still working through it to try to make it work on https://github.com/goware/jwtutil .. it seems my ghcr.io/goware/jwtutil package is "private", even though the repo is public. It's too bad as this is a very elegant integration I'm sure many GH engineers worked hard to provide, yet it doesn't work if people can't use it easily.. |
Beta Was this translation helpful? Give feedback.
-
|
Any updates on this issue? It's unacceptable that GH doesn't have this built-in, especially when using GHCR. |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue here :( |
Beta Was this translation helpful? Give feedback.
-
|
I'm staggered to find out that I can't pull a container image from my organisation'g GHCR from a workflow in the same organisation. Despite the fact that a lot of the Github docs infer that this should be possible by setting the Repo access on the image, and the package permissions on the GITHUB_TOKEN. This seems like a massive miss, really hope this arrives soon. |
Beta Was this translation helpful? Give feedback.
-
|
ran in the same issue with crown's docker based action crowdin/crowdin-cli#827 |
Beta Was this translation helpful? Give feedback.
-
|
I don't get why this feature request is problematic or hard to solve(?) in the first place. Now that jobs can use container in a private registry, all the basics for also providing the same capability for actions should be there, no? By basics I mean fetching the workflow file early enough in the overall processing to configure the runner's Docker At the very least, please provide support for actions in private registries for GH Enterprise ASAP. My employer for example simply doesn't allow anything related to building our software on the public internet with anonymous access, period. |
Beta Was this translation helpful? Give feedback.
-
|
Another comment requesting a fix to this problem. |
Beta Was this translation helpful? Give feedback.
-
|
My experience was that I had to use the workaround #3 as listed above : the The The documentation on this process is internally confusing and inconsistent. The implication is that either path should work, but it clearly does not. |
Beta Was this translation helpful? Give feedback.
-
|
I've configured all the relevant permissions but still, github actions is unauthorized at ghcr.io? My use case:
Trying to get this to work has been a miserable user experience. |
Beta Was this translation helpful? Give feedback.
-
|
I'm on self-hosted runners and have exactly the same problem. No reasonable solution there apart from Github to start respecting the permissions model where we already allow packages to be pulled. And we allow it in two places - |
Beta Was this translation helpful? Give feedback.
-
|
Solved the issue by using the 2. workaround with my local development environment, like:
for now I'm fine with it; cause I can develop my action with private images like the way the action would be consumed. Is it possible to inject / set the |
Beta Was this translation helpful? Give feedback.
-
|
For my specific case, being authenticated on the self-hosted runner with a The authentication method is a classic PAT token. Permissions are correct on the PAT token (READ for packages). Package is available to my user. All of this was confirmed by a successful pull outside of the self-hosted runner. Here is the code that eventually allowed it to work (step only): |
Beta Was this translation helpful? Give feedback.
-
|
I think the main issue is that GitHub doesn't natively support pulling in containers in docker actions from a private feed. Some workarounds:
Edit: see my comment for 2 other options. |
Beta Was this translation helpful? Give feedback.
-
|
Just sharing a simple solution/workaround that worked for me (but I understand that it won't work for people who want to run the entire job on a container from GHCR): Pulling the image ahead of time allows it to then be used by the following steps/actions without requiring auth: - uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image
run: docker pull ghcr.io/org/repo
shell: bash
# other steps can now use the image, because it is local and Docker won't even check the authSo to solve the OP's problem, this should work: jobs:
repo-sync-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
token: ${{ secrets.PAT }}
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # Or maybe ${{ secrets.PAT }} ?
- name: Pull docker image
run: docker pull ghcr.io/org/repo
shell: bash
# Now this should work!
- name: repo-sync-gomisha
uses: gomisha/[email protected]
with:
source_repo: "https://github.com/gomisha/repo-sync-test-public"
source_branch: "main"
destination_branch: "main"
github_token: ${{ secrets.PAT }} |
Beta Was this translation helpful? Give feedback.
-
|
π Discussion Activity Reminder π This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1οΈβ£ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2οΈβ£ Provide More Information: Share additional details or context β or let the community know if you've found a solution on your own. 3οΈβ£ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! π¬ |
Beta Was this translation helpful? Give feedback.
-
|
π Discussion Activity Reminder π This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1οΈβ£ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2οΈβ£ Provide More Information: Share additional details or context β or let the community know if you've found a solution on your own. 3οΈβ£ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! π¬ |
Beta Was this translation helpful? Give feedback.
-
|
π Discussion Activity Reminder π This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1οΈβ£ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2οΈβ£ Provide More Information: Share additional details or context β or let the community know if you've found a solution on your own. 3οΈβ£ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! π¬ |
Beta Was this translation helpful? Give feedback.
-
|
Still facing the same insane issue... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I have the following GitHub Actions that I'm trying to run but I keep getting an "unauthorized error" when the Action is trying to pull the Docker image from GitHub Packages registry in the
repo-sync-gomishastep.I keep getting the following error when trying to pull a Docker image from GitHub Packages registry. The image I'm trying to pull is a forked GitHub action, which I'm able to push to the registry.
Error response from daemon: Head "https://ghcr.io/v2/gomisha/github-sync/manifests/v2.3.1": unauthorizedThese are all the failed attempts from the public repo that's trying to use the forked GitHub action:
https://github.com/gomisha/repo-sync-test-private/actions
This is the GitHub Actions workflow file I'm using to pull the docker image of the reusable GitHub Action:
https://github.com/gomisha/repo-sync-test-private/blob/main/.github/workflows/repo-sync.yml
Here is a specific error when I run this workflow:
I'm not sure why I'm getting this unauthorized error.
I can successfully build the Docker image of the GitHub action and upload it to GitHub Package registry. It's only when I try and pull that image from another GitHub Action that I get the above error.
This is the forked GitHub Action that I can successfully build the Docker image and deploy to GitHub Packages registry:
https://github.com/gomisha/github-sync
Here is the last successful deployment of this GitHub Action to the GitHub Package registry.
Solutions Attempted
Things I have tried (but weren't successful):
GITHUB_TOKENinstead of personal access token and giving it very permissive settings so it would have permission to access the GitHub Package registry:going to package settings: https://github.com/orgs/gomisha/packages/container/github-sync/settings
and adding https://github.com/gomisha/repo-sync-test-private/ repo to have access to the package
pulling this image locally to my machine
docker login ghcr.iodocker pull ghcr.io/gomisha/github-sync:v2.3.1So the image is there in the registry and I can even pull it locally, but I can't pull it from my GitHub Actions workflow for some reason.
going to package settings: https://github.com/orgs/gomisha/packages/container/github-sync/settings
and adding https://github.com/gomisha/repo-sync-test-private/ repo to have access to the package
Beta Was this translation helpful? Give feedback.
All reactions