Skip to content

Commit 79ed48d

Browse files
authored
Merge pull request #313 from nanotaboada/feat/292-verify-tag-reachable-from-master
ci(cd): verify tag commit is reachable from master (#292)
2 parents c231aee + 3a77647 commit 79ed48d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/maven-cd.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545

46+
- name: Verify tag commit is reachable from master
47+
run: |
48+
if ! git merge-base --is-ancestor "${{ github.sha }}" origin/master; then
49+
echo "❌ Tag commit ${{ github.sha }} is not reachable from origin/master"
50+
exit 1
51+
fi
52+
echo "✅ Tag commit ${{ github.sha }} is reachable from origin/master"
53+
4654
- name: Extract and validate tag components
4755
id: tag
4856
run: |

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ Release names follow the **historic football clubs** naming convention (A–Z):
5555
in-memory with `ddl.sql`/`dml.sql`; switch `spring.jpa.hibernate.ddl-auto`
5656
from `none` to `validate` so Hibernate verifies entity mappings against the
5757
Flyway-managed schema (#130)
58+
- Add runtime verification step to the CD workflow that checks whether the tag
59+
commit is reachable from `origin/master` before proceeding with build and
60+
publish steps, preventing accidental releases from unmerged branches (#292)
5861

5962
### Changed
6063

0 commit comments

Comments
 (0)