From 3b337ea038b9f22ec1941e2510ba40e7a2843b84 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 6 Jul 2026 11:46:20 +0300 Subject: [PATCH] chore: Add check for no commits to make a PR --- .github/workflows/open_pull_request.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/open_pull_request.yml b/.github/workflows/open_pull_request.yml index 91b1b4411..8aac13af5 100644 --- a/.github/workflows/open_pull_request.yml +++ b/.github/workflows/open_pull_request.yml @@ -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" \