Template
mirror of
https://github.com/MorpheApp/morphe-patches-template.git
synced 2026-11-30 23:09:34 +00:00
chore: Add check for no commits to make a PR
This commit is contained in:
1 parent
6add74a124
commit
3b337ea038
1 file changed
+7
@@ -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" \
|
||||
|
||||
Reference in new issue
Block a user