-
Notifications
You must be signed in to change notification settings - Fork 233
38 lines (36 loc) · 980 Bytes
/
code.yaml
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: Code Lint
on:
pull_request:
branches:
- main
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/code.yml"
jobs:
lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Go Environment
uses: actions/setup-go@v5
with:
go-version-file: go.mod
id: go
# https://github.com/reviewdog/reviewdog/issues/1158
# Permissions need to match container user
- name: "Give Permissions"
run: |
sudo chown -R root $GITHUB_WORKSPACE
- name: Spelling Check
uses: reviewdog/[email protected]
- name: Revive Action
uses: morphy2k/revive-action@v2
- name: "Restore Permissions"
run: |
sudo chown -R $(id -u) $GITHUB_WORKSPACE
- name: Check formatting
run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)