2222 contents : read
2323 pull-requests : write
2424 steps :
25+ - name : Debug workflow run info
26+ env :
27+ WORKFLOW_RUN_ID : ${{ github.event.workflow_run.id }}
28+ WORKFLOW_CONCLUSION : ${{ github.event.workflow_run.conclusion }}
29+ WORKFLOW_EVENT : ${{ github.event.workflow_run.event }}
30+ HEAD_BRANCH : ${{ github.event.workflow_run.head_branch }}
31+ HEAD_SHA : ${{ github.event.workflow_run.head_sha }}
32+ run : |
33+ echo "=== Workflow Run Info ==="
34+ echo "Workflow run ID: $WORKFLOW_RUN_ID"
35+ echo "Workflow run conclusion: $WORKFLOW_CONCLUSION"
36+ echo "Workflow run event: $WORKFLOW_EVENT"
37+ echo "Head branch: $HEAD_BRANCH"
38+ echo "Head SHA: $HEAD_SHA"
2539 - name : Download artifacts
2640 id : download
2741 uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
@@ -31,19 +45,48 @@ jobs:
3145 path : pr_artifacts/
3246 run-id : ${{ github.event.workflow_run.id }}
3347 github-token : ${{ secrets.GITHUB_TOKEN }}
48+ - name : Debug download result
49+ env :
50+ DOWNLOAD_OUTCOME : ${{ steps.download.outcome }}
51+ run : |
52+ echo "=== Download Result ==="
53+ echo "Download outcome: $DOWNLOAD_OUTCOME"
54+ echo "Listing pr_artifacts directory:"
55+ ls -la pr_artifacts/ 2>/dev/null || echo "Directory does not exist"
3456 - name : Get PR number
3557 if : steps.download.outcome == 'success'
3658 id : pr
37- run : echo "number=$(cat pr_artifacts/pr_number)" >> "$GITHUB_OUTPUT"
59+ run : |
60+ echo "=== PR Number ==="
61+ cat pr_artifacts/pr_number
62+ echo "number=$(cat pr_artifacts/pr_number)" >> "$GITHUB_OUTPUT"
3863 - name : Check if diff is empty
3964 if : steps.download.outcome == 'success'
4065 id : diff
4166 run : |
67+ echo "=== Diff Check ==="
68+ echo "Diff file size: $(wc -c < pr_artifacts/lintrunner.diff) bytes"
69+ echo "Diff file lines: $(wc -l < pr_artifacts/lintrunner.diff) lines"
4270 if [ -s pr_artifacts/lintrunner.diff ]; then
4371 echo "has_changes=true" >> "$GITHUB_OUTPUT"
72+ echo "Diff has changes, showing first 50 lines:"
73+ head -50 pr_artifacts/lintrunner.diff
4474 else
4575 echo "has_changes=false" >> "$GITHUB_OUTPUT"
76+ echo "Diff is empty, no changes to apply"
4677 fi
78+ - name : Debug before checkout
79+ if : steps.download.outcome == 'success'
80+ env :
81+ DOWNLOAD_OUTCOME : ${{ steps.download.outcome }}
82+ HAS_CHANGES : ${{ steps.diff.outputs.has_changes }}
83+ PR_NUMBER : ${{ steps.pr.outputs.number }}
84+ run : |
85+ echo "=== Pre-Checkout Debug ==="
86+ echo "Download outcome: $DOWNLOAD_OUTCOME"
87+ echo "Has changes: $HAS_CHANGES"
88+ echo "PR number: $PR_NUMBER"
89+ echo "Will checkout: ${{ steps.download.outcome == 'success' && steps.diff.outputs.has_changes == 'true' }}"
4790 - name : Checkout PR
4891 if : steps.download.outcome == 'success' && steps.diff.outputs.has_changes == 'true'
4992 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5295 persist-credentials : false
5396 - name : Apply lintrunner fixes
5497 if : steps.download.outcome == 'success' && steps.diff.outputs.has_changes == 'true'
55- run : git apply pr_artifacts/lintrunner.diff
98+ run : |
99+ echo "=== Applying Diff ==="
100+ echo "Current directory: $(pwd)"
101+ echo "Git status before apply:"
102+ git status --short
103+ echo "Applying diff..."
104+ git apply pr_artifacts/lintrunner.diff
105+ echo "Git status after apply:"
106+ git status --short
56107 - name : Suggest changes
57108 if : steps.download.outcome == 'success' && steps.diff.outputs.has_changes == 'true'
58109 uses : parkerbxyz/suggest-changes@bd099ea0d10f0e9efeb9e46d604bbe6d7a80bc34
0 commit comments