From 2a6349d4cd31889e0f3a6379979d4f748e1ebaf1 Mon Sep 17 00:00:00 2001 From: Nano Taboada <87288+nanotaboada@users.noreply.github.com> Date: Fri, 3 Apr 2026 12:03:48 -0300 Subject: [PATCH] ci(cd): verify tag commit is reachable from master (#439) Co-authored-by: Claude Sonnet 4.6 --- .github/workflows/dotnet-cd.yml | 9 +++++++++ CHANGELOG.md | 2 ++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/dotnet-cd.yml b/.github/workflows/dotnet-cd.yml index 971a857..ae0b139 100644 --- a/.github/workflows/dotnet-cd.yml +++ b/.github/workflows/dotnet-cd.yml @@ -25,6 +25,15 @@ jobs: with: fetch-depth: 0 + - name: Verify tag commit is reachable from master + run: | + if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then + echo "❌ Error: Tag commit ${{ github.sha }} is not reachable from origin/master" + echo "Ensure the PR is merged to master before pushing a release tag" + exit 1 + fi + echo "✅ Verified: commit is reachable from master" + - name: Extract version from tag id: version run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 981d60b..f5aa253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,8 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc ### Changed +- Add "Verify tag commit is reachable from master" step to CD workflow using `git merge-base --is-ancestor` before any build or publish steps (#439) + ### Fixed - `GET /players` now returns `200 OK` with an empty list `[]` when no players exist, instead of `404 Not Found` (#425)