Download tarballs instead of Git repos for "3rdparty/uvatlas". #9308
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: Style Check | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, reopened, synchronize] # Rebuild on new pushes to PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| style-check: | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python version | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| pip install -U -r python/requirements_style.txt | |
| - name: Apply style formatting | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| python util/check_style.py --apply | |
| - name: Check style formatting | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| python util/check_style.py | |
| - name: Commit and push changes | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add -u | |
| if ! git diff --staged --quiet; then | |
| git commit -m "Apply automatic code formatting" | |
| git push || exit 1 | |
| else | |
| echo "No formatting changes needed" | |
| fi | |
| - name: Check for formatting changes from fork | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository | |
| run: | | |
| git add -u | |
| if ! git diff --staged --quiet; then | |
| echo "::error::This PR requires formatting changes but is from a fork. Please run 'python util/check_style.py --apply' locally and push the changes." | |
| exit 1 | |
| else | |
| echo "No formatting changes needed" | |
| fi |