From 68ce73deb1207d9315f1978417475e7702ba5404 Mon Sep 17 00:00:00 2001 From: NiftyAndy Date: Tue, 28 Jul 2026 05:23:34 -0400 Subject: [PATCH] fix(release-pr): skip empty promotions --- .github/workflows/reusable-release-pr.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-release-pr.yml b/.github/workflows/reusable-release-pr.yml index 107c5677..8ddd3efe 100644 --- a/.github/workflows/reusable-release-pr.yml +++ b/.github/workflows/reusable-release-pr.yml @@ -30,10 +30,17 @@ jobs: --head staging \ --state open \ --json number | jq 'length') + COMPARE_URL="repos/${GITHUB_REPOSITORY}/compare/main...staging" + TOTAL_COMMITS=$(gh api "$COMPARE_URL?per_page=1" --jq '.total_commits // 0') echo "existing=$EXISTING" >> "$GITHUB_OUTPUT" + echo "commits=$TOTAL_COMMITS" >> "$GITHUB_OUTPUT" + + - name: No changes + if: steps.check-pr.outputs.existing == '0' && steps.check-pr.outputs.commits == '0' + run: echo 'staging is already aligned with main; no promotion PR is needed.' - name: Create - if: steps.check-pr.outputs.existing == '0' + if: steps.check-pr.outputs.existing == '0' && steps.check-pr.outputs.commits != '0' run: | DATE=$(date +%Y-%m-%d) BODY_FILE="$RUNNER_TEMP/release-pr.md"