Skip to content
This repository was archived by the owner on Jun 16, 2022. It is now read-only.

Commit ad917f2

Browse files
authored
Merge pull request #5 from dsp-testing/lsep/go-list-impl
Go list implementation for detecting dependencies
2 parents a53b2da + f2af090 commit ad917f2

18 files changed

+481
-3407
lines changed

.github/workflows/go-action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Go Action detection of dependencies
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
go-action-detection:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: 'Checkout Repository'
11+
uses: actions/checkout@v3
12+
- uses: actions/setup-go@v3
13+
with:
14+
go-version: ">=1.18.0"
15+
- name: Run snapshot action
16+
uses: dsp-testing/go-snapshot-action@lsep/go-list-impl
17+
with:
18+
go-mod-path: go-example/go.mod
19+
go-build-target: go-example/cmd/octocat.go

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ An Action that creates a dependency submission using `go mod graph`.
55
Optional inputs for the Action include: `detector-name`, `detector-url`, `detector-version`, and `metadata` - a JSON of max eight keys to provide with the snapshot.
66

77
### Example
8-
```
8+
```yaml
99
name: Go Action detection of dependencies
1010
on:
1111
push:
@@ -27,6 +27,16 @@ jobs:
2727
- name: Run snapshot action
2828
uses: @dsp-testing/go-snapshot-action
2929
with:
30+
# Required: Define the repo path to the go.mod file used by the
31+
# build target
32+
go-mod-path: go-example/go.mod
33+
#
34+
# Define the repo path of a build target (a file with a
35+
# `main()` function) If not defined, this Aciton will collect all
36+
# dependencies used by all build targets for the module, which may
37+
# include Go dependencies used by tests and tooling.
38+
go-build-target: go-example/cmd/octocat.go
39+
#
3040
# All of the below have defaults, but can be overriden manually
3141
detector-name: go snapshot action
3242
detector-url: ${{ github.server_url }}/${{ github.repository }}

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ inputs:
2121
metadata:
2222
required: false
2323
description: 'User provided map of max key/value pairs of metadata to include with the snapshot e.g. {"lastModified": "12-31-2022"}'
24+
go-mod-path:
25+
required: true
26+
description: 'Repo path to the go.mod file used to detect dependencies for the Go build target'
27+
go-build-target:
28+
required: true
29+
description: 'Build target to detect build dependencies. If unspecified, will use "all", with will detect all dependencies used in all build targets (including tests and tools).'
30+
default: 'all'
2431
runs:
2532
using: 'node16'
2633
main: 'dist/index.js'

dist/go_mod_parser.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)