|
82 | 82 |
|
83 | 83 | - name: Run Trunk Upgrade |
84 | 84 | id: trunk-upgrade |
85 | | - uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19 |
| 85 | + uses: trunk-io/trunk-action/upgrade@75699af9e26881e564e9d832ef7dc3af25ec031b # v1.2.4 |
86 | 86 | with: |
87 | 87 | github-token: ${{ steps.github-token.outputs.token }} |
88 | 88 | reviewers: ${{ inputs.reviewers }} |
@@ -124,10 +124,8 @@ runs: |
124 | 124 | echo "$1" | jq '[.[] | select(.state!="SUCCESS" or .bucket!="pass")] | length' |
125 | 125 | } |
126 | 126 |
|
127 | | - approve_and_merge_pr() { |
128 | | - local approval_message="$1" |
129 | | - echo "🤖 Auto-approving and merging PR $REPO_URL/pull/$PR_NUMBER..." |
130 | | - gh pr review "$PR_NUMBER" --approve --body "$approval_message" |
| 127 | + merge_pr() { |
| 128 | + echo "🤖 Auto-merging PR $REPO_URL/pull/$PR_NUMBER..." |
131 | 129 |
|
132 | 130 | # Retry merge up to 3 times to handle base branch updates |
133 | 131 | local max_retries=3 |
@@ -169,8 +167,8 @@ runs: |
169 | 167 | # Handle case with no required checks - can merge immediately |
170 | 168 | if [ "$REQUIRED_COUNT" -eq 0 ]; then |
171 | 169 | echo "✅ No required status checks configured. PR is ready to merge." |
172 | | - echo "Proceeding with auto-approval and merge..." |
173 | | - if approve_and_merge_pr "Auto-approved by trunk upgrade action (no required status checks)"; then |
| 170 | + echo "Proceeding with auto-merge..." |
| 171 | + if merge_pr; then |
174 | 172 | exit 0 |
175 | 173 | else |
176 | 174 | echo "❌ Failed to merge PR. Exiting with error." |
@@ -208,7 +206,7 @@ runs: |
208 | 206 | # Check if all required checks have passed |
209 | 207 | PENDING_COUNT=$(count_pending_checks "$CURRENT_CHECKS") |
210 | 208 | if [ "$PENDING_COUNT" -eq 0 ]; then |
211 | | - if approve_and_merge_pr "Auto-approved by trunk upgrade action (all required checks passed)"; then |
| 209 | + if merge_pr; then |
212 | 210 | break |
213 | 211 | else |
214 | 212 | echo "❌ Failed to merge PR after all checks passed. Exiting with error." |
|
0 commit comments