feat: OpenTofu support #6401
Workflow file for this run
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: linter | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
branches: | |
- "main" | |
- "release-**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
# Required: allow read access to the content for analysis. | |
contents: read | |
# Optional: allow read access to pull request. Use with `only-new-issues` option. | |
pull-requests: read | |
# Optional: Allow write access to checks to allow the action to annotate code in the PR. | |
checks: write | |
jobs: | |
changes: | |
outputs: | |
should-run-linting: ${{ steps.changes.outputs.go == 'true' }} | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3 | |
id: changes | |
with: | |
filters: | | |
go: | |
- '**.go' | |
- 'go.*' | |
- '.github/workflows/lint.yml' | |
- '.golangci.yml' | |
golangci-lint: | |
needs: [changes] | |
if: github.event.pull_request.draft == false && needs.changes.outputs.should-run-linting == 'true' | |
name: Linting | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
# need to setup go toolchain explicitly | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 | |
with: | |
go-version-file: go.mod | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6 | |
with: | |
# renovate: datasource=github-releases depName=golangci/golangci-lint | |
version: v1.60.1 | |
skip-lint: | |
needs: [changes] | |
if: needs.changes.outputs.should-run-linting == 'false' | |
name: Linting | |
runs-on: ubuntu-24.04 | |
steps: | |
- run: 'echo "No build required"' |