Extract weighted quantile cut fixes from #12129 #799
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: XGBoost CI (Pre-commit) | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'release_*' | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| name: Run pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/[email protected] | |
| with: | |
| python-version: "3.11" | |
| - name: Install pre-commit | |
| run: python -m pip install pre-commit | |
| - name: Run pre-commit on updated files | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| FROM_REF="${{ github.event.pull_request.base.sha }}" | |
| TO_REF="${{ github.event.pull_request.head.sha }}" | |
| else | |
| FROM_REF="${{ github.event.before }}" | |
| TO_REF="${{ github.sha }}" | |
| fi | |
| if [ "${FROM_REF}" = "0000000000000000000000000000000000000000" ]; then | |
| FROM_REF="$(git hash-object -t tree /dev/null)" | |
| fi | |
| pre-commit run --from-ref "${FROM_REF}" --to-ref "${TO_REF}" --show-diff-on-failure |