From ebd3c50df7091fdae13377cdee1d2456c74db567 Mon Sep 17 00:00:00 2001 From: node9 Date: Wed, 8 Apr 2026 12:47:14 +0300 Subject: [PATCH] fix: skip PR creation when dev has no new commits vs main Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/auto-pr.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml index 30de97b..de35fff 100644 --- a/.github/workflows/auto-pr.yml +++ b/.github/workflows/auto-pr.yml @@ -26,6 +26,12 @@ jobs: > - `feat:` to publish a Minor release (0.X.0) > If it starts with `chore:`, no PyPI package will be published! run: | + git fetch origin main + COMMITS=$(git log origin/main..origin/dev --oneline | wc -l) + if [ "$COMMITS" -eq 0 ]; then + echo "No commits between dev and main — nothing to release, skipping PR." + exit 0 + fi PR=$(gh pr list --base main --head dev --state open --json number -q '.[0].number') if [ -z "$PR" ]; then gh pr create \