|
70 | 70 | GH_REPO: ${{ github.repository }} |
71 | 71 | PR_NUMBER: ${{ steps.pr.outputs.number }} |
72 | 72 | run: | |
73 | | - if gh pr checks "$PR_NUMBER" --required; then |
| 73 | + if checks_output="$(gh pr checks "$PR_NUMBER" --required 2>&1)"; then |
| 74 | + echo "passed=true" >> "$GITHUB_OUTPUT" |
| 75 | + elif echo "$checks_output" | grep -q "no required checks reported"; then |
| 76 | + echo "No required checks configured for this PR; treating as pass for automerge gating." |
74 | 77 | echo "passed=true" >> "$GITHUB_OUTPUT" |
75 | 78 | else |
76 | 79 | echo "passed=false" >> "$GITHUB_OUTPUT" |
|
90 | 93 | echo "touches_workflows=false" >> "$GITHUB_OUTPUT" |
91 | 94 | fi |
92 | 95 |
|
| 96 | + - name: Debug automerge prerequisites |
| 97 | + if: steps.pr.outputs.eligible == 'true' |
| 98 | + env: |
| 99 | + GH_TOKEN: ${{ secrets.AUTOMERGE_GH_TOKEN != '' && secrets.AUTOMERGE_GH_TOKEN || secrets.GITHUB_TOKEN }} |
| 100 | + PR_NUMBER: ${{ steps.pr.outputs.number }} |
| 101 | + REPO: ${{ github.repository }} |
| 102 | + run: | |
| 103 | + echo "actor=${GITHUB_ACTOR}" |
| 104 | + echo "event=${GITHUB_EVENT_NAME}" |
| 105 | + echo "pr_eligible=${{ steps.pr.outputs.eligible }}" |
| 106 | + echo "pr_number=${PR_NUMBER}" |
| 107 | + echo "checks_passed=${{ steps.checks.outputs.passed }}" |
| 108 | + echo "touches_workflows=${{ steps.changed-files.outputs.touches_workflows || 'unknown' }}" |
| 109 | + gh auth status || true |
| 110 | + gh pr view "$PR_NUMBER" --repo "$REPO" \ |
| 111 | + --json number,author,isDraft,mergeStateStatus,maintainerCanModify,state,autoMergeRequest \ |
| 112 | + --jq '{number, author: .author.login, isDraft, mergeStateStatus, maintainerCanModify, state, autoMerge: .autoMergeRequest != null}' |
| 113 | +
|
93 | 114 | - name: Require dedicated token for workflow changes |
94 | 115 | if: > |
95 | 116 | steps.pr.outputs.eligible == 'true' && |
|
0 commit comments