diff --git a/.github/workflows/sync-template.yml b/.github/workflows/sync-template.yml index 8b6c4358..ad753e27 100644 --- a/.github/workflows/sync-template.yml +++ b/.github/workflows/sync-template.yml @@ -42,6 +42,15 @@ jobs: cp -rf ts-template/* . rm -rf ts-template/ git add . + if git diff --staged --quiet; then + echo "No changes to sync from template." + exit 0 + fi git commit -m "chore: sync template" + git fetch origin "$pr_branch" + git pull origin "$branch_name" --rebase git push "$original_remote" "$pr_branch" - gh pr create --title "Sync branch to template" --body "This pull request merges changes from the template repository." --head "$pr_branch" --base "$branch_name" + gh pr create --title "Sync branch to template" \ + --body "This pull request merges changes from the template repository." \ + --head "$pr_branch" \ + --base "$branch_name" \ No newline at end of file