Skip to content

Commit be28004

Browse files
committed
fix(ci): stabilize release PR workflow create path
1 parent 054847b commit be28004

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/release-pr.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,28 @@ jobs:
1919

2020
- name: Open or update release PR
2121
env:
22-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
GH_TOKEN: ${{ secrets.RELEASE_PR_TOKEN }}
23+
DEFAULT_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2324
PR_TITLE: "Release: develop → main"
2425
PR_TEMPLATE: .github/PULL_REQUEST_TEMPLATE.md
2526
run: |
2627
set -euo pipefail
2728
29+
export GH_TOKEN="${GH_TOKEN:-$DEFAULT_GH_TOKEN}"
30+
2831
if [ ! -f "$PR_TEMPLATE" ]; then
2932
echo "Pull request template not found at $PR_TEMPLATE"
3033
exit 1
3134
fi
3235
3336
git fetch origin main --prune
3437
38+
COMMIT_COUNT="$(git rev-list --count origin/main..HEAD)"
39+
if [ "$COMMIT_COUNT" -eq 0 ]; then
40+
echo "No commits to merge from develop into main. Skipping release PR sync."
41+
exit 0
42+
fi
43+
3544
BODY_FILE="$(mktemp)"
3645
export BODY_FILE
3746

0 commit comments

Comments
 (0)