-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.11 KB
/
job-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
name: Lint Job
on:
workflow_call:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version: "1.22"
cache: false
- name: Install gofumpt
uses: jaxxstorm/action-install-gh-release@25d5e2dd555cd74f1fab9ac1e6ea117acde2c0c4 # v1.12.0
with:
repo: mvdan/gofumpt
tag: v0.5.0
cache: enable
extension-matching: nah
rename-to: gofumpt
chmod: 0700
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Check code formatting
run: |
set -euo pipefail
gofumpt -l $( \
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT \
"origin/$GITHUB_BASE_REF..origin/$GITHUB_HEAD_REF" \
| grep '\.go$' \
) \
| tee /dev/stderr \
| test $(wc -l) -eq 0
- uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6