Repository navigation
Only push to GHCR on merge to main - #122
Merged
Merged
Conversation
The deploy job previously ran on every same-repo pull request, pushing `pr-NN` and `pr-NN-sha-...` images to GHCR. That cluttered the registry and exposed `packages: write` on PR-triggered runs. Restrict the deploy job to `push` events on `main`. Pull requests still exercise the build, test, and integration jobs but no longer publish images. Simplifies the tag-computation step accordingly (no PR branch left to handle). Made-with: Cursor
…-deploy-main-only
gekiclaws
self-requested a review
April 27, 2026 21:05
Contributor
|
Forgot to click approve. But looks good! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
deployjob inci-cd.ymlcurrently runs on every same-repo pull request and pushes images to GHCR taggedpr-<num>andpr-<num>-sha-<sha>. That clutters the registry with throwaway tags and exposespackages: writeon every PR-triggered run.This PR restricts
deploytopushevents onmainonly. Pull requests still run the fulldetect-changes+build+backend-integrationmatrix; they just no longer publish images.Changes
deploy.ifdrops thepull_requestbranch — now gated ongithub.event_name == 'push' && github.ref == 'refs/heads/main'.pr-<num>branch, only emits:latestand:sha-<sha>.deployjob explaining the policy.Net diff:
+12 / -23lines, single file (.github/workflows/ci-cd.yml).Test plan
detect-changes→build→backend-integrationand does not runbuild & push GHCR images.ghcr.io/cmu-413/avenu-*while this PR is open.deployand publishes:latest+:sha-<sha>for each changed service.:latest) still resolves after the next merge.