openverse-frontend
openverse-frontend copied to clipboard
PR GHCR builds are adding `main` tag
Description
The main tag is being added to GCHR builds from PRs, not just for pushes to main.
Reproduction
- Go to this PR workflow run: https://github.com/WordPress/openverse-frontend/runs/8000864384?check_suite_focus=true
- Open the `metadata-action` action log and expand the tags
- See that the sha and `main` tag are both there. We should just have the `sha` tag, no main.
Additional context
I don't know why the main tag is being added. It's only meant to be added on a push event, not a PR event :thinking:
https://github.com/WordPress/openverse-frontend/blob/cff57efcd2121561ad4b6e7eccb6e3e6dfd71b31/.github/workflows/ghcr.yml#L58
Maybe I don't understand the push event? Maybe we also need to check the branch name or something.
Resolution
- [ ] 🙋 I would be interested in resolving this bug.
Downgrading this to medium actually because we're deploying staging using the specific sha tag now instead of main. However, we sometimes redeploy staging using the main tag (probably should not do that, maybe another issue to restrict using generic tags would be good OR remove the need to pass a tag to redeploy altogether and have a checkbox to confirm a redeploy is intended and just pull the current version from the version.json endpoint on the environment :thinking:)