Merge remote-tracking branch 'upstream/main' into sync-main #1
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request_target: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| # Require approval for external contributors | |
| environment: | |
| name: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || '' }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| # For pull_request_target, check out the PR head commit | |
| ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }} | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run pre-commit | |
| uses: j178/prek-action@v1 |