Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't push to ghcr on a pull request #870

Closed
localagi opened this issue May 29, 2023 · 2 comments
Closed

Can't push to ghcr on a pull request #870

localagi opened this issue May 29, 2023 · 2 comments

Comments

@localagi
Copy link

localagi commented May 29, 2023

Troubleshooting

Before submitting a bug report please read the Troubleshooting doc.

=> Thanks, i added the debug flag

Behaviour

Steps to reproduce this issue

  1. have a project with a docker build push action on the workflow
  2. enable the runs on pull requests
  3. have a pull request, the build push action fails with 403

Expected behaviour

The push works with the tag :pr-123 into the target repository

Actual behaviour

Login into registry works with ${github.actor}
Push should go to target repository, but fails.
Error: buildx failed with: ERROR: failed to solve: failed to push ghcr.io/josh-xt/agixt:pr-499: unexpected status: 403 Forbidden

Configuration

https://github.com/Josh-XT/AGiXT/actions/runs/5111667183/jobs/9188888271?pr=499

https://github.com/Josh-XT/AGiXT/blob/main/.github/workflows/publish-docker.yml

https://github.com/localagi/AI-pipeline/blob/main/.github/workflows/operation-docker-build-publish.yml

logs_2922.zip

@localagi localagi mentioned this issue May 29, 2023
9 tasks
@vfiset
Copy link

vfiset commented Jun 1, 2023

setting this in the docker build env might help

@crazy-max
Copy link
Member

https://github.com/Josh-XT/AGiXT/actions/runs/5111667183/jobs/9188888271?pr=499

Don't think this is related but the build push action is not configured properly: https://github.com/Josh-XT/AGiXT/actions/runs/5111667183/jobs/9188888271?pr=499#step:15:1

image

buildkitd-flags does not exist in this action: https://github.com/localagi/AI-pipeline/blob/3007b9776a982006265c1fb85622248c86a6bd25/.github/workflows/operation-docker-build-publish.yml#L214

Should be done in setup-buildx-action: https://github.com/docker/setup-buildx-action#inputs

The push works with the tag :pr-123 into the target repository

Doesn't look possible from a public forked repo as stipulated in GitHub docs. See "Maximum access for pull requests from public forked repositories": https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants