-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
43 lines (41 loc) · 1.27 KB
/
action.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
39
40
41
42
43
name: "golang deadcode action"
description: "Run the golang deadcode checker"
author: "opzkit"
inputs:
packages:
description: 'Run deadcode on these packages.'
required: false
default: './...'
go-version-file:
description: 'Path to the go.mod file.'
required: false
go-version:
description: 'The go version to use when running deadcode check'
required: false
check-latest:
description: 'Set this option to true if you want the action to always check for the latest available version that satisfies the version spec'
default: false
godeadcode-version:
description: 'The deadcode version to use'
required: false
default: 'latest'
runs:
using: 'composite'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
go-version-file: ${{ inputs.go-version-file }}
check-latest: ${{ inputs.check-latest }}
- name: Get deadcode
run: go install golang.org/x/tools/cmd/deadcode@${{ inputs.godeadcode-version }}
shell: bash
- name: Run go deadcode
run: deadcode --test ${{ inputs.packages }}
shell: bash
branding:
icon: 'alert-triangle'
color: 'red'