feat: add group-level postprocess hook for custom result aggregation #3583
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: write | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up uv and Python | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Run pre-commit (autofix) | |
| run: uvx pre-commit run --all-files || true | |
| - name: Commit fixes if any | |
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
| run: | | |
| git diff --quiet && exit 0 | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "style: auto-fix lint (ruff check + format)" | |
| git push | |
| - name: Ensure lint leaves clean tree | |
| run: | | |
| git diff --quiet && exit 0 | |
| echo "Lint generated changes that could not be auto-pushed in this context." | |
| echo "Please run 'uv run pre-commit run --all-files' locally and push the fixes." | |
| git --no-pager diff --name-only | |
| exit 1 |