Confine release + publish builds to main #7

Merged
Mondrethos merged 2 commits from fix/release-only-on-main into main 2026-06-18 08:23:43 +00:00
Mondrethos commented 2026-06-18 08:01:18 +00:00 (Migrated from github.com)

Two related fixes so feature-branch pushes stop performing main-only actions. Both touch build.yml only.

1. Only generate releases on main

generate-release was guarded with if: github.event_name != 'pull_request', but the push trigger had no branch filter — so pushing a feature branch fired a push-event build where the guard passed, ran Generate Release, and re-pointed the dated release tag at an unmerged commit (observed on the PR #5 branch: 2026-06-17 got re-targeted).

Fix: add && github.ref == 'refs/heads/main'.

2. Only build push events on main

The unfiltered push trigger also meant a same-repo branch push fired a push-event build in addition to the pull_request build — two redundant Build Custom Image checks per PR, and the push one published :latest/dated tags from unmerged code.

Fix: push: branches: [main].

Preserved

  • PR test builds still run via the pull_request trigger (the rebaseable pr-N image).
  • Merges to main still build, publish :latest, and cut a release.
  • Schedule and dispatch unaffected.

Net effect: a PR now shows a single (pull_request) build check, and nothing off main publishes images or releases.

Two related fixes so feature-branch pushes stop performing `main`-only actions. Both touch `build.yml` only. ## 1. Only generate releases on main `generate-release` was guarded with `if: github.event_name != 'pull_request'`, but the `push` trigger had no branch filter — so pushing a feature branch fired a `push`-event build where the guard passed, ran Generate Release, and re-pointed the dated release tag at an **unmerged** commit (observed on the PR #5 branch: `2026-06-17` got re-targeted). Fix: add `&& github.ref == 'refs/heads/main'`. ## 2. Only build push events on main The unfiltered `push` trigger also meant a same-repo branch push fired a `push`-event build **in addition to** the `pull_request` build — two redundant `Build Custom Image` checks per PR, and the `push` one published `:latest`/dated tags from unmerged code. Fix: `push: branches: [main]`. ## Preserved - **PR test builds** still run via the `pull_request` trigger (the rebaseable `pr-N` image). - **Merges to `main`** still build, publish `:latest`, and cut a release. - Schedule and dispatch unaffected. Net effect: a PR now shows a single `(pull_request)` build check, and nothing off `main` publishes images or releases.
Sign in to join this conversation.
No description provided.