-
Notifications
You must be signed in to change notification settings - Fork 7
Verify tag commit is reachable from master before release #292
Copy link
Copy link
Open
Labels
containersPull requests that update containers codePull requests that update containers codeenhancementNew feature or requestNew feature or requestgithub_actionsPull requests that update GitHub Actions codePull requests that update GitHub Actions codepriority lowNice-to-have improvement. Can be deferred without blocking other work.Nice-to-have improvement. Can be deferred without blocking other work.
Metadata
Metadata
Assignees
Labels
containersPull requests that update containers codePull requests that update containers codeenhancementNew feature or requestNew feature or requestgithub_actionsPull requests that update GitHub Actions codePull requests that update GitHub Actions codepriority lowNice-to-have improvement. Can be deferred without blocking other work.Nice-to-have improvement. Can be deferred without blocking other work.
Summary
Add a runtime verification step to the CD workflow (
.github/workflows/maven-cd.yml) that checks whether the tag's commit is reachable frommasterbefore proceeding with build and publish steps. This ensures the CD pipeline does not trigger on an unmerged commit if a tag is accidentally pushed from a release branch before the PR is merged.Motivation
The CD workflow currently triggers on any tag matching
v*.*.*-*with no safeguard that the tag points to a commit contained inmaster. The Pre-Release Checklist enforces process discipline (merge before tagging), but a runtime guard in the workflow would provide an additional safety net.Proposed Approach
Add a step named "Verify tag commit is reachable from master" to the existing
releasejob, placed immediately afterCheckout repository. A separate job is not warranted here — the checkout already usesfetch-depth: 0so full git history is available, and the check is lightweight enough that spinning up a second runner would be unnecessary overhead.The step should verify that
${{ github.sha }}is reachable fromrefs/heads/masterusing either:git branch -r --contains ${{ github.sha }}and checking fororigin/masterin the output, orrefs/heads/masterThe job should fail with a clear error message if the check does not pass.
Acceptance Criteria
master