chore: Add check for no commits to make a PR

This commit is contained in:
LisoUseInAIKyrios committed 2026-07-06 11:46:20 +03:00
1 parent 6add74a124
commit 3b337ea038
1 file changed
+7
+7
View File
@@ -30,6 +30,13 @@ jobs:
exit 0
fi
# Check if there are any commits between branches
COMMITS=$(gh api "repos/${{ github.repository }}/compare/${TARGET_BRANCH}...${SOURCE_BRANCH}" --jq '.total_commits')
if [ "$COMMITS" -eq 0 ]; then
echo "No commits between $TARGET_BRANCH and $SOURCE_BRANCH. Skipping PR creation."
exit 0
fi
# Try to create the PR
gh pr create \
--base "$TARGET_BRANCH" \