|
60 | 60 | # Fix any lint or format issues
|
61 | 61 |
|
62 | 62 | - name: Auto-Fix Ruff Lint Issues
|
63 |
| - run: poetry run ruff check --fix . |
| 63 | + run: poetry run ruff check --fix . || true |
64 | 64 | - name: Auto-Fix Ruff Format Issues
|
65 |
| - run: poetry run ruff format . |
| 65 | + run: poetry run ruff format . || true |
66 | 66 |
|
67 | 67 | # Check for changes in git
|
68 | 68 |
|
|
72 | 72 | git diff --quiet && echo "No changes to commit" || echo "::set-output name=changes::true"
|
73 | 73 | shell: bash
|
74 | 74 |
|
75 |
| - # Commit and push the changes (if any) |
| 75 | + # Commit changes (if any) |
76 | 76 |
|
77 | 77 | - name: Commit changes
|
78 | 78 | if: steps.git-diff.outputs.changes == 'true'
|
|
82 | 82 | git add .
|
83 | 83 | git commit -m "Auto-fix lint and format issues"
|
84 | 84 |
|
| 85 | + # Fix any further 'unsafe' lint issues in a separate commit |
| 86 | + |
| 87 | + - name: Auto-Fix Ruff Lint Issues (Unsafe) |
| 88 | + run: poetry run ruff check --fix --unsafe . || true |
| 89 | + - name: Auto-Fix Ruff Format Issues |
| 90 | + run: poetry run ruff format . || true |
| 91 | + |
| 92 | + # Check for changes in git (2nd time, for 'unsafe' lint fixes) |
| 93 | + |
| 94 | + - name: Check for changes ('unsafe' fixes) |
| 95 | + id: git-diff-2 |
| 96 | + run: | |
| 97 | + git diff --quiet && echo "No changes to commit" || echo "::set-output name=changes::true" |
| 98 | + shell: bash |
| 99 | + |
| 100 | + - name: Commit 'unsafe' lint fixes |
| 101 | + if: steps.git-diff-2.outputs.changes == 'true' |
| 102 | + run: | |
| 103 | + git config --global user.name "octavia-squidington-iii" |
| 104 | + git config --global user.email "[email protected]" |
| 105 | + git add . |
| 106 | + git commit -m "Auto-fix lint issues (unsafe)" |
| 107 | +
|
85 | 108 | - name: Push changes
|
86 |
| - if: steps.git-diff.outputs.changes == 'true' |
| 109 | + if: steps.git-diff.outputs.changes == 'true' || steps.git-diff-2.outputs.changes == 'true' |
87 | 110 | run: git push origin HEAD
|
0 commit comments