mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-29 05:18:22 +00:00
55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
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
|
|
|
|
jobs:
|
|
changes:
|
|
outputs:
|
|
should-run-linting: ${{ steps.changes.outputs.go == 'true' }}
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v2
|
|
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-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: golangci-lint
|
|
uses: reviewdog/action-golangci-lint@v2
|
|
with:
|
|
tool_name: golangci-lint
|
|
|
|
skip-lint:
|
|
needs: [changes]
|
|
if: needs.changes.outputs.should-run-linting == 'false'
|
|
name: Linting
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- run: 'echo "No build required"'
|