Fix non-ASCII characters in headers being rejected (#5377) (#5699) #4
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: Pre-commit | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Prevents sdist builds → no tar extraction | |
| PIP_ONLY_BINARY: ":all:" | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup GitHub App Bot | |
| id: setup-bot | |
| uses: ./.github/actions/setup-bot | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: 3.12 | |
| cache: "pip" # caching pip dependencies | |
| cache-dependency-path: ./.github/scripts/requirements_pre_commit.txt | |
| - name: Run Pre-Commit Hooks | |
| run: | | |
| pip install --require-hashes --only-binary=:all: -r ./.github/scripts/requirements_pre_commit.txt | |
| - name: Run Pre-Commit | |
| run: | | |
| pre-commit run ruff --all-files -c .pre-commit-config.yaml | |
| pre-commit run ruff-format --all-files -c .pre-commit-config.yaml | |
| pre-commit run codespell --all-files -c .pre-commit-config.yaml | |
| pre-commit run gitleaks --all-files -c .pre-commit-config.yaml | |
| pre-commit run end-of-file-fixer --all-files -c .pre-commit-config.yaml | |
| pre-commit run trailing-whitespace --all-files -c .pre-commit-config.yaml | |
| continue-on-error: true | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: "25" | |
| distribution: "temurin" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1 | |
| with: | |
| gradle-version: 8.14 | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| env: | |
| MAVEN_USER: ${{ secrets.MAVEN_USER }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
| MAVEN_PUBLIC_URL: ${{ secrets.MAVEN_PUBLIC_URL }} | |
| - name: git add | |
| run: | | |
| git add . | |
| git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV | |
| - name: Create Pull Request | |
| if: env.CHANGES_DETECTED == 'true' | |
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| with: | |
| token: ${{ steps.setup-bot.outputs.token }} | |
| commit-message: ":file_folder: pre-commit" | |
| committer: ${{ steps.setup-bot.outputs.committer }} | |
| author: ${{ steps.setup-bot.outputs.committer }} | |
| signoff: true | |
| branch: pre-commit | |
| title: "🤖 format everything with pre-commit by ${{ steps.setup-bot.outputs.app-slug }}" | |
| body: | | |
| Auto-generated by [create-pull-request][1] with **${{ steps.setup-bot.outputs.app-slug }}** | |
| [1]: https://github.com/peter-evans/create-pull-request | |
| draft: false | |
| delete-branch: true | |
| labels: github-actions | |
| sign-commits: true |