From 7a087cfa14658c50d1df44ff09dc00bf25c4e5c3 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Mon, 2 Mar 2026 15:08:14 +0300 Subject: [PATCH] Fix auto-pr to not fail when branches are already in sync --- .github/workflows/auto-pr.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-pr.yml b/.github/workflows/auto-pr.yml index 0d2679a..2fce8e7 100644 --- a/.github/workflows/auto-pr.yml +++ b/.github/workflows/auto-pr.yml @@ -23,13 +23,18 @@ jobs: if [ -n "$EXISTING_PR" ]; then echo "PR #$EXISTING_PR already exists — new commits will appear automatically" - else - echo "Creating new PR: master → main" - gh pr create \ - --base main \ - --head master \ - --title "Sync: master → main" \ - --body "Automated PR to sync master branch changes to main. - - This PR was created automatically and will be merged once CI checks pass." + exit 0 + fi + + echo "Creating new PR: master → main" + if gh pr create \ + --base main \ + --head master \ + --title "Sync: master → main" \ + --body "Automated PR to sync master branch changes to main. + + This PR was created automatically and will be merged once CI checks pass."; then + echo "PR created successfully" + else + echo "PR creation skipped (branches may already be in sync)" fi