From 290b379bbaa71da48e5797e4884560a028087877 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Tue, 26 Sep 2023 15:31:16 -0400 Subject: [PATCH] Issue #111: Adoptium actions adds source --- actions/adoptium-dependency/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/actions/adoptium-dependency/main.go b/actions/adoptium-dependency/main.go index d5d7717a..b47b0a15 100644 --- a/actions/adoptium-dependency/main.go +++ b/actions/adoptium-dependency/main.go @@ -70,8 +70,10 @@ func main() { } versions := make(actions.Versions) + additionalOutputs := make(actions.Outputs) for _, r := range raw { versions[strings.ReplaceAll(r.VersionData.Semver, "+", "-")] = r.Binaries[0].Package.Link + additionalOutputs["source"] = r.Source.Link } latestVersion, err := versions.GetLatestVersion(inputs) @@ -79,7 +81,7 @@ func main() { panic(fmt.Errorf("unable to get latest version\n%w", err)) } - outputs, err := actions.NewOutputs(versions[latestVersion.Original()], latestVersion, nil) + outputs, err := actions.NewOutputs(versions[latestVersion.Original()], latestVersion, additionalOutputs) if err != nil { panic(fmt.Errorf("unable to create outputs\n%w", err)) } @@ -98,6 +100,7 @@ func main() { type Asset struct { Binaries []Binary VersionData VersionData `json:"version_data"` + Source Source } type Binary struct { @@ -108,6 +111,10 @@ type Package struct { Link string } +type Source struct { + Link string +} + type VersionData struct { Semver string }