ci: Prepare for the 1.2.0 release (#611) #1688
This file contains 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: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
GOLANGCI_LINT_VERSION: "v1.52.1" | |
GOLANG_VERSION: "1.19.x" | |
TFUPDATE_VERSION: "v0.6.7" | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.0.0 | |
with: | |
fetch-depth: '0' | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GOLANG_VERSION }} | |
- name: Install required tools | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $HOME/.local/bin ${{ env.GOLANGCI_LINT_VERSION }} | |
golangci-lint --version | |
go install github.com/minamijoyo/tfupdate@${{ env.TFUPDATE_VERSION }} | |
tfupdate --version | |
- name: Enforce pre-commit checks | |
uses: pre-commit/action@v3.0.0 | |
with: | |
extra_args: --hook-stage push --from-ref origin/main --to-ref ${{ github.event.pull_request.head.sha || github.ref }} |