Skip to content

[pg][raster] Fix stats calculation when extent is specified #13492

[pg][raster] Fix stats calculation when extent is specified

[pg][raster] Fix stats calculation when extent is specified #13492

Workflow file for this run

name: Pre-commit checks
on:
pull_request:
push:
branches:
- master
- release-*
jobs:
pre-commit:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
issues: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 200
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install pre-commit
run: pip install pre-commit
- name: Install deps
run: sudo apt-get install -y silversearcher-ag astyle flip expect
- name: Run pre-commit
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin ${{ github.event.pull_request.base.ref }}
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-head
git checkout pr-head
MERGE_BASE=$(git merge-base origin/${{ github.event.pull_request.base.ref }} pr-head)
MODIFIED_FILES=($(git diff --name-only $MERGE_BASE pr-head))
elif [ "${{ github.event_name }}" == "push" ]; then
MODIFIED_FILES=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }}))
else
echo "Unsupported event: ${{ github.event_name }}"
exit 1
fi
echo "Modified files: ${MODIFIED_FILES[@]}"
pre-commit run --files ${MODIFIED_FILES[@]} || (echo "Differences:" && git diff && echo "pre-commit failed. Attempting to auto-fix..." && exit 1)
- name: Commit fixes
if: failure()
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "auto-fix pre-commit issues" || echo "No changes to commit"
- name: Auto-commit fixes
if: failure() && github.event_name == 'push'
run: git push || echo "Failed to push changes. Please check permissions or conflicts."