From 475e59a9c7c6b6492273e705247d30fdf0f7453a Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Sun, 22 Mar 2026 02:04:09 +0100 Subject: [PATCH] fix(ci): skip release PR validation when release branch does not exist When simple-release-action finds no releasable commits it succeeds without creating the release branch. The next step then fails with a 404 on `gh api .../git/ref/heads/release`. Guard against this by checking the branch exists before triggering CI. --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbd50758..e0adc5e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,12 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - HEAD_SHA=$(gh api repos/${{ github.repository }}/git/ref/heads/release --jq '.object.sha') + HEAD_SHA=$(gh api repos/${{ github.repository }}/git/ref/heads/release --jq '.object.sha' 2>/dev/null) || true + + if [ -z "$HEAD_SHA" ]; then + echo "No release branch found — nothing to validate" + exit 0 + fi gh workflow run code-pull-request.yml --ref release sleep 5