2323 actions : read
2424 contents : read
2525 pull-requests : write
26- issues : write
2726 id-token : write
2827
2928 steps :
4948 with :
5049 fetch-depth : 1
5150
52- - uses : actions/setup-python@v5
53- with :
54- python-version : " 3.12"
55-
56- - name : Install lintrunner
57- run : |
58- pip install lintrunner==0.12.5
59- lintrunner init
60-
6151 - name : Generate script-verified facts
6252 id : facts
6353 env :
7969 CHANGED_FILES=$(gh pr diff "$PR_NUMBER" --name-only 2>&1)
8070 FILE_COUNT=$(echo "$CHANGED_FILES" | wc -l | tr -d ' ')
8171
82- # Run lintrunner
83- LINT_OUTPUT=$(lintrunner -m main 2>&1)
84- LINT_EXIT=$?
85- if [ $LINT_EXIT -eq 0 ]; then
86- LINT_STATUS="Passed"
87- else
88- LINT_ERRORS=$(echo "$LINT_OUTPUT" | grep -c "error" || echo "0")
89- LINT_STATUS="Failed (${LINT_ERRORS} errors)"
90- fi
91-
9272 # Check for new dependencies in requirements.txt
9373 NEW_DEPS="None"
9474 if echo "$CHANGED_FILES" | grep -q "requirements.txt"; then
@@ -139,7 +119,6 @@ jobs:
139119 "files_display": $(echo "$FILES_DISPLAY" | jq -Rs .),
140120 "additions": ${PR_ADDITIONS},
141121 "deletions": ${PR_DELETIONS},
142- "lint_status": $(echo "$LINT_STATUS" | jq -Rs .),
143122 "new_deps": $(echo "$NEW_DEPS" | jq -Rs .),
144123 "card_status": $(echo "$CARD_STATUS" | jq -Rs .),
145124 "thumbnail_status": $(echo "$THUMB_STATUS" | jq -Rs .)
@@ -151,7 +130,6 @@ jobs:
151130 |-------|--------|
152131 | Files changed | ${FILES_DISPLAY} |
153132 | Lines | +${PR_ADDITIONS} / -${PR_DELETIONS} |
154- | Lintrunner | ${LINT_STATUS} |
155133 | New dependencies | ${NEW_DEPS} |
156134 | Card entry (index.rst) | ${CARD_STATUS} |
157135 | Thumbnail | ${THUMB_STATUS} |"
0 commit comments