Skip to content

Merge pull request #479 from ccamel/dependabot/github_actions/tj-acti… #282

Merge pull request #479 from ccamel/dependabot/github_actions/tj-acti…

Merge pull request #479 from ccamel/dependabot/github_actions/tj-acti… #282

Workflow file for this run

name: Lint
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-markdown:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Lint regular markdown files
uses: avto-dev/markdown-lint@v1.5.0
with:
args: "**/*.md"
ignore: "CHANGELOG.md"
lint-go:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Find changed go files
id: changed-go-files
uses: tj-actions/changed-files@v45.0.3
with:
files: |
**/*.go
go.mod
go.sum
- name: Setup Go environment
uses: actions/setup-go@v5.0.2
if: steps.changed-go-files.outputs.any_changed == 'true'
with:
go-version: "1.21"
cache: false
- name: Lint go code (golangci-lint)
uses: golangci/golangci-lint-action@v6
if: steps.changed-go-files.outputs.any_changed == 'true'
with:
version: v1.54
- name: Lint go code (gofumpt)
if: steps.changed-go-files.outputs.any_changed == 'true'
run: |
go install mvdan.cc/gofumpt@v0.5.0
if [ "$(gofumpt -l .)" != "" ]; then
echo "❌ Code is not gofumpt!"
exit 1
fi
echo "✅ Code is gofumpt!"
lint-yaml:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Lint yaml files
uses: ibiqlik/action-yamllint@v3.1.1
lint-dockerfile:
runs-on: ubuntu-22.04
if: github.actor != 'dependabot[bot]'
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Lint dockerfile (hadolint)
uses: hadolint/hadolint-action@v3.1.0
with:
verbose: true
ignore: DL3003