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

Prevent forks from trying (and failing) to push latest images to GHCR #11213

Merged

Conversation

jeffwidman
Copy link
Member

I noticed on a recent commit to main on my personal fork that it's trying/failing to push images to GHCR due to permissions errors: https://github.com/jeffwidman/dependabot-core/actions/runs/12593801189

There's no point in forks doing that--they will never have the proper permissions to publish images to the real GitHub GHCR Dependabot image.

We already prevent forks from trying to publish the base updater image here:

if: github.repository == 'dependabot/dependabot-core'

We just forgot to also do it in this workflow for the final ecosystem images.

So this rectifies that.

@jeffwidman jeffwidman requested a review from a team as a code owner January 3, 2025 06:48
@@ -11,6 +11,7 @@ on: # yamllint disable-line rule:truthy
jobs:
date-version:
runs-on: ubuntu-latest
if: github.repository == 'dependabot/dependabot-core'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the subsequent push-updater-image job has needs: date-version, if this causes the date-version job to be skipped, then the push-updater-image job will also get skipped.

I noticed on a recent commit to `main` on my personal fork that it's trying/failing to push images to GHCR due to permissions errors: https://github.com/jeffwidman/dependabot-core/actions/runs/12593801189

There's no point in forks doing that--they will never have the proper permissions to publish images to the real GitHub GHCR Dependabot image.

We already prevent forks from trying to publish the base updater image here:
https://github.com/dependabot/dependabot-core/blob/53178c5d340c7fcb171d5aec7e640d350f3f837c/.github/workflows/images-updater-core.yml#L14

We just forgot to also do it in this workflow for the final ecosystem images.

So this rectifies that.
@jeffwidman jeffwidman force-pushed the prevent-forks-from-trying-to-publish-ecosystem-images branch from 3d365bd to 7a4812b Compare January 3, 2025 18:09
@jeffwidman jeffwidman enabled auto-merge (squash) January 3, 2025 18:09
@jeffwidman jeffwidman merged commit 9208a0d into main Jan 3, 2025
54 checks passed
@jeffwidman jeffwidman deleted the prevent-forks-from-trying-to-publish-ecosystem-images branch January 3, 2025 18:13
@jeffwidman
Copy link
Member Author

Confirmed working by sync'ing the latest changes to my personal fork. 🎉

Screenshot 2025-01-03 at 10 19 13 AM

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