-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.61 KB
/
linting.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Linting
env:
GOPRIVATE: "github.com/carted"
on:
workflow_call:
secrets:
token:
description: "The GitHub token to use for the workflow."
required: true
inputs:
go-version:
description: "The Go version to use for the build."
required: false
type: string
default: 1.19
github-username:
description: "The GitHub username to use for the build."
required: false
type: string
default: "cartedbot"
jobs:
golangci:
runs-on: [ self-hosted, linux ]
steps:
- name: Cleanup
run: |
cd ~
rm -rf .gitconfig
- uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
- name: Get source
uses: actions/checkout@v3
- name: Get github-workflows repository
uses: actions/checkout@v3
with:
repository: carted/github-workflows
path: './.workdir/github-workflows/'
token: ${{ secrets.token }}
- name: Private GitHub repos
run: git config --global url."https://${{ inputs.github-username }}:${{ secrets.token }}@github.com/carted".insteadOf "https://github.com/carted"
- name: Fix deps
run: |
go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.2.0
with:
version: v1.49.0
args: "--out-${NO_FUTURE}format colored-line-number --config ./.workdir/github-workflows/linting/.golangci.yml"
only-new-issues: true
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true