Skip to content

Trigger the release by merging the Release PR, not by pushing a tag - #14

Merged
pbujna-apius merged 1 commit into
mainfrom
ci/release-on-merge
Aug 11, 2026
Merged

pbujna-apius merged 1 commit into
mainfrom
ci/release-on-merge

Conversation

@pbujna-apius

Copy link
Copy Markdown
Contributor

Why

v1.0.3 is the motivating case: prepare-release ran, the Release PR merged, CI went green — and nothing was released, because the manual git push origin v1.0.3 never happened. A skipped step that produces a fully green pipeline and no release is the worst kind of manual step.

What changed

.github/workflows/release.yml now triggers on push to main instead of on a v* tag, and omits the version input. The shared workflow:

  • reads the version from the stamped app.conf (no retyping it into a tag)
  • skips the release when that version is already tagged, so ordinary pushes to main are no-ops and a re-run can't double-release
  • creates the vX.Y.Z tag itself via gh release create --target <sha>

The local version job that stripped v from the tag name is gone — nothing to strip.

Release flow, before → after

Before After
1 Dispatch prepare-release Dispatch prepare-release
2 Review + merge Release PR Review + merge Release PR
3 git tag + git push —
4 Approve Splunkbase deploy Approve Splunkbase deploy

No new credentials

A tag pushed with GITHUB_TOKEN does not trigger on: push: tags, so auto-pushing the tag would have required a PAT or GitHub App token. Minting the tag inside the run that already built the package avoids that entirely. contents: write on the caller job is the same grant as before.

Splunkbase publish is unchanged

Still gated on this repo's splunkbase Environment (required reviewer), held before any step runs. Approve to publish; leave it unapproved and the GitHub Release stands with nothing uploaded — that approval is now the only human decision point after the merge.

One behavioural note: previously "don't publish this one" could be expressed by simply never pushing the tag. Now the release always runs and the decision moves to the approval prompt, where rejecting marks the run failed even though it's a legitimate outcome. Adding a clean-green skip would mean carrying a flag from the dispatch through to post-merge (e.g. a no-publish PR label); deliberately left out as not worth the complexity.

Depends on

apius-tech/splunk-app-ci#6 — makes version optional and adds the resolution/skip job. Merge that first. Until it lands, @main still declares version as required and the Actions linter flags this caller as invalid.

ADR-0004 has been amended to match (kept in the private docs mirror, since docs/adr/ is gitignored here).

Verification

Workflow YAML parsed and inputs checked. The auto path genuinely can't be exercised before the next real release — the first prepare-release dispatch after both PRs merge is the test. Worth doing that on a patch version so a failure is cheap.

Merging the "Release vX.Y.Z" PR left the repo stamped but inert until a
maintainer remembered to push the tag. When that was missed the whole pipeline
stayed green with nothing released — v1.0.3 sat merged and untagged.

The caller now runs on push to main and omits `version`, so the shared workflow
reads it from the stamped app.conf, skips the release when that version is
already tagged, and creates the tag itself alongside the GitHub Release.

A release is now two human actions: dispatch prepare-release with the version,
then approve the Splunkbase deployment. The Splunkbase gate is unchanged.

Requires apius-tech/splunk-app-ci#6 (makes `version` optional and adds the
version-resolution job); until that merges, @main still declares `version` as
required and this caller will not validate.
@pbujna-apius
pbujna-apius requested a review from a team as a code owner August 11, 2026 10:47
@pbujna-apius
pbujna-apius merged commit 63fe7f2 into main Aug 11, 2026
1 check passed
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.

1 participant