| 1 |
name: Lint Go |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_dispatch: {} |
| 5 |
workflow_call: |
| 6 |
pull_request: |
| 7 |
branches: [main] |
| 8 |
paths: |
| 9 |
- internal/** |
| 10 |
- pkg/** |
| 11 |
- shoutrrr/** |
| 12 |
- go.mod |
| 13 |
- go.sum |
| 14 |
- shoutrrr.go |
| 15 |
|
| 16 |
permissions: |
| 17 |
contents: read # Set default read-only permissions |
| 18 |
|
| 19 |
jobs: |
| 20 |
lint: |
| 21 |
name: Run Golangci-lint |
| 22 |
runs-on: ubuntu-latest |
| 23 |
permissions: |
| 24 |
pull-requests: read |
| 25 |
steps: |
| 26 |
- name: Harden the Runner (Step Security) |
| 27 |
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
| 28 |
with: |
| 29 |
egress-policy: audit |
| 30 |
|
| 31 |
- name: Checkout Repo |
| 32 |
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 33 |
with: |
| 34 |
fetch-depth: 0 |
| 35 |
persist-credentials: false |
| 36 |
|
| 37 |
- name: Setup Go |
| 38 |
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 39 |
with: |
| 40 |
cache: true |
| 41 |
cache-dependency-path: "**/go.sum" |
| 42 |
go-version-file: go.mod |
| 43 |
|
| 44 |
- name: Run golangci-lint |
| 45 |
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 |
| 46 |
with: |
| 47 |
args: --timeout=5m --config=build/golangci-lint/golangci.yaml |
| 48 |
only-new-issues: true |