Skip to content

Commit 06d633f

Browse files
authored
Enhance pylint workflow with report and score extraction
Updated pylint workflow to save report and extract score.
1 parent 4c0827f commit 06d633f

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ jobs:
2020
pip install pylint
2121
- name: Analysing the code with pylint
2222
run: |
23-
pylint $(git ls-files '*.py')
24-
- name: Extract score
23+
pylint $(git ls-files '*.py') > pylint_report.txt || true
24+
- name: Extract pylint score
2525
id: extract_score
2626
run: |
27-
score=$(grep "rated at" pylint-output.txt | sed -E 's/.*rated at ([0-9]+\.[0-9]+)\/10.*/\1/')
28-
echo "score=$score" >> $GITHUB_OUTPUT
29-
- name: Set badge label (optional)
30-
run: |
31-
echo "::set-output name=badge_url::https://img.shields.io/badge/pylint-${{ steps.extract_score.outputs.score }}%2F10-brightgreen"
27+
SCORE=$(grep -oP '(?<=Your code has been rated at )[-0-9\.]+' pylint_report.txt)
28+
echo "score=$SCORE" >> $GITHUB_OUTPUT
29+
echo "Pylint score: $SCORE"
30+
31+
- name: Upload pylint report
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: pylint-report
35+
path: pylint_report.txt

0 commit comments

Comments
 (0)