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

Go list implementation for detecting dependencies #5

Merged
merged 23 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/go-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Go Action detection of dependencies
on:
push:
branches:
- main
jobs:
go-action-detection:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
- name: Run snapshot action
uses: dsp-testing/go-snapshot-action@lsep/go-list-impl
with:
go-mod-path: go-example/go.mod
go-build-target: go-example/cmd/octocat.go
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ An Action that creates a dependency submission using `go mod graph`.
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.

### Example
```
```yaml
name: Go Action detection of dependencies
on:
push:
Expand All @@ -27,6 +27,16 @@ jobs:
- name: Run snapshot action
uses: @dsp-testing/go-snapshot-action
with:
# Required: Define the repo path to the go.mod file used by the
# build target
go-mod-path: go-example/go.mod
#
# Define the repo path of a build target (a file with a
# `main()` function) If not defined, this Aciton will collect all
# dependencies used by all build targets for the module, which may
# include Go dependencies used by tests and tooling.
go-build-target: go-example/cmd/octocat.go
#
# All of the below have defaults, but can be overriden manually
detector-name: go snapshot action
detector-url: ${{ github.server_url }}/${{ github.repository }}
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ inputs:
metadata:
required: false
description: 'User provided map of max key/value pairs of metadata to include with the snapshot e.g. {"lastModified": "12-31-2022"}'
go-mod-path:
required: true
description: 'Repo path to the go.mod file used to detect dependencies for the Go build target'
go-build-target:
required: true
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).'
default: 'all'
runs:
using: 'node16'
main: 'dist/index.js'
42 changes: 0 additions & 42 deletions dist/go_mod_parser.js

This file was deleted.

Loading