Skip to content

Commit

Permalink
refactor(wip): gutsy-moose
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonhull committed Sep 27, 2022
1 parent 45c3761 commit 93e5aef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/DelineaXPM/dsv-github-action
go 1.19

require (
github.com/bitfield/script v0.20.2
github.com/caarlos0/env/v6 v6.10.1
github.com/magefile/mage v1.13.0
github.com/matryer/is v1.4.0
Expand All @@ -14,7 +15,6 @@ require (
atomicgo.dev/cursor v0.1.1 // indirect
atomicgo.dev/keyboard v0.2.8 // indirect
bitbucket.org/creachadair/shell v0.0.7 // indirect
github.com/bitfield/script v0.20.2 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/gookit/color v1.5.0 // indirect
Expand Down
13 changes: 12 additions & 1 deletion magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"github.com/sheldonhull/magetools/precommit"
//mage:import
_ "github.com/sheldonhull/magetools/secrets"

"github.com/bitfield/script"
)

// Test contains mage tasks for testing.
Expand Down Expand Up @@ -69,10 +71,19 @@ func Init() error {
(gotools.Go{}.Init),
(gittools.Gittools{}.Init),
(precommit.Precommit{}.Init),
(InstallSyft),
)
return nil
}

func InstallSyft() error {
_, err := script.Exec("curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh").Exec("sh -s -- -b /usr/local/bin").Stdout()
if err != nil {
return err
}
return nil
}

// Clean up after yourself.
func Clean() {
pterm.Success.Println("Cleaning...")
Expand Down Expand Up @@ -118,7 +129,7 @@ func PullImage() error {
// TestIntegration runs local act cli to test the integration.
func (Test) Integration() error {
// Mg.Deps(PullImage).
currentDescribedTag, err := sh.Output("git", "describe","--tags","--abbrev=0")
currentDescribedTag, err := sh.Output("git", "describe", "--tags", "--abbrev=0")
if err != nil {
pterm.Error.Printfln("unable to retrieve tag: %v", err)
return err
Expand Down

0 comments on commit 93e5aef

Please sign in to comment.