Skip to content

Commit

Permalink
refactor: bump actions/runtime version for generator (#181)
Browse files Browse the repository at this point in the history
* refactor: bump actions/runtime version for generator

* build: bump actions/runtime dependencies for generated modules
  • Loading branch information
aweris authored Nov 8, 2023
1 parent e0f087c commit bc4664c
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 33 deletions.
7 changes: 5 additions & 2 deletions daggerverse/actions/generator/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ var (
jen.Line().Comment("Repository name, format: owner/name. Takes precedence over `--source`.").Line().Id("repo").Id("Optional[string]"),
jen.Line().Comment("Tag name to check out. Only works with `--repo`. Takes precedence over `--branch`.").Line().Id("tag").Id("Optional[string]"),
jen.Line().Comment("Branch name to check out. Only works with `--repo`.").Line().Id("branch").Id("Optional[string]"),
jen.Line().Comment("Image for the runner.").Line().Id("runnerImage").Id("Optional[string]"),
jen.Line().Comment("Image to use for the runner. If --image and --container provided together, --image takes precedence.").Line().Id("image").Id("Optional[string]"),
jen.Line().Comment("Container to use for the runner. If --image and --container provided together, --image takes precedence.").Line().Id("container").Id("Optional[*Container]"),
jen.Line().Comment("Enables debug mode.").Line().Id("runnerDebug").Id("Optional[bool]"),
jen.Line().Comment("GitHub token. May be required for certain actions.").Line().Id("token").Id("Optional[*Secret]"),
}

DefaultRuntimeRunOpts = jen.Id("ActionsRuntimeRunOpts").
Values(
jen.Dict{
jen.Id("Source"): jen.Id("source.GetOr(nil)"),
jen.Id("Repo"): jen.Id("repo.GetOr(\"\")"),
jen.Id("Tag"): jen.Id("tag.GetOr(\"\")"),
jen.Id("Branch"): jen.Id("branch.GetOr(\"\")"),
jen.Id("RunnerImage"): jen.Id("runnerImage.GetOr(\"\")"),
jen.Id("Image"): jen.Id("image.GetOr(\"\")"),
jen.Id("Container"): jen.Id("container.GetOr(nil)"),
jen.Id("RunnerDebug"): jen.Id("runnerDebug.GetOr(false)"),
jen.Id("Token"): jen.Id("token.GetOr(nil)"),
},
Expand Down
8 changes: 6 additions & 2 deletions daggerverse/actions/generator/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ func generateModuleREADME(ca *action, daggerVersion string) *File {
Required: "Conditional",
Desc: "Branch name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence.",
},
"--runner-image": {
"--image": {
Required: "Optional",
Desc: "Image to use for the runner.",
Desc: "Image to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence.",
},
"--container": {
Required: "Optional",
Desc: "Container to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence.",
},
"--runner-debug": {
Required: "Optional",
Expand Down
2 changes: 1 addition & 1 deletion daggerverse/actions/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
)

const DefaultRuntimeRef = "da8e5dada0126583ef9201b8d6b494af765b7d31"
const DefaultRuntimeRef = "e0f087ca2b2b6cb2e2cb2360e497c7e19c2b9365"

// ActionsGenerator generates dagger modules using Github Actions.
type ActionsGenerator struct{}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module: Hello World
# Module: Hello, World!

![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.1-green)
![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.3-green)

Greet someone and record the time

Expand Down Expand Up @@ -30,9 +30,10 @@ Replace `<module-path>` with the local path or a git repo reference to the modul
| Flag | Required | Description |
| ------| ------| ------|
| --branch | Conditional | Branch name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --container | Optional | Container to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --image | Optional | Image to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --repo | Conditional | The name of the repository (owner/name). Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --runner-debug | Optional | Enables debug mode. |
| --runner-image | Optional | Image to use for the runner. |
| --source | Conditional | The directory containing the repository source. Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --tag | Conditional | Tag name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --token | Optional | GitHub token is optional for running the action. However, be aware that certain custom actions may require a token and could fail if it's not provided. |
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "hello-world-javascript-action",
"sdk": "go",
"dependencies": [
"github.com/aweris/gale/daggerverse/actions/runtime@da8e5dada0126583ef9201b8d6b494af765b7d31"
"github.com/aweris/gale/daggerverse/actions/runtime@e0f087ca2b2b6cb2e2cb2360e497c7e19c2b9365"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/99designs/gqlgen v0.17.31
github.com/Khan/genqlient v0.6.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/sync v0.3.0
golang.org/x/sync v0.4.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions daggerverse/gha/actions/hello-world-javascript-action/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq
github.com/vektah/gqlparser/v2 v2.5.6/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
9 changes: 6 additions & 3 deletions daggerverse/gha/actions/hello-world-javascript-action/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions daggerverse/gha/aquasecurity/trivy-action/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module: Aqua Security Trivy

![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.1-green)
![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.3-green)

Scans container images for vulnerabilities with Trivy

Expand Down Expand Up @@ -53,9 +53,10 @@ Replace `<module-path>` with the local path or a git repo reference to the modul
| Flag | Required | Description |
| ------| ------| ------|
| --branch | Conditional | Branch name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --container | Optional | Container to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --image | Optional | Image to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --repo | Conditional | The name of the repository (owner/name). Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --runner-debug | Optional | Enables debug mode. |
| --runner-image | Optional | Image to use for the runner. |
| --source | Conditional | The directory containing the repository source. Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --tag | Conditional | Tag name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --token | Optional | GitHub token is optional for running the action. However, be aware that certain custom actions may require a token and could fail if it's not provided. |
2 changes: 1 addition & 1 deletion daggerverse/gha/aquasecurity/trivy-action/dagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "trivy-action",
"sdk": "go",
"dependencies": [
"github.com/aweris/gale/daggerverse/actions/runtime@da8e5dada0126583ef9201b8d6b494af765b7d31"
"github.com/aweris/gale/daggerverse/actions/runtime@e0f087ca2b2b6cb2e2cb2360e497c7e19c2b9365"
]
}
2 changes: 1 addition & 1 deletion daggerverse/gha/aquasecurity/trivy-action/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/99designs/gqlgen v0.17.31
github.com/Khan/genqlient v0.6.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/sync v0.3.0
golang.org/x/sync v0.4.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions daggerverse/gha/aquasecurity/trivy-action/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq
github.com/vektah/gqlparser/v2 v2.5.6/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
9 changes: 6 additions & 3 deletions daggerverse/gha/aquasecurity/trivy-action/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions daggerverse/gha/trufflesecurity/trufflehog/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Module: TruffleHog OSS

![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.1-green)
![dagger-min-version](https://img.shields.io/badge/dagger%20version-v0.9.3-green)

Scan Github Actions with TruffleHog

Expand Down Expand Up @@ -33,9 +33,10 @@ Replace `<module-path>` with the local path or a git repo reference to the modul
| Flag | Required | Description |
| ------| ------| ------|
| --branch | Conditional | Branch name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --container | Optional | Container to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --image | Optional | Image to use for the runner. If `--image` and `--container` are provided together, `--image` takes precedence. |
| --repo | Conditional | The name of the repository (owner/name). Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --runner-debug | Optional | Enables debug mode. |
| --runner-image | Optional | Image to use for the runner. |
| --source | Conditional | The directory containing the repository source. Either `--source` or `--repo` must be provided; `--source` takes precedence. |
| --tag | Conditional | Tag name to check out. Only works with `--repo`. Either `--tag` or `--branch` must be provided; `--tag` takes precedence. |
| --token | Optional | GitHub token is optional for running the action. However, be aware that certain custom actions may require a token and could fail if it's not provided. |
2 changes: 1 addition & 1 deletion daggerverse/gha/trufflesecurity/trufflehog/dagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "trufflehog",
"sdk": "go",
"dependencies": [
"github.com/aweris/gale/daggerverse/actions/runtime@da8e5dada0126583ef9201b8d6b494af765b7d31"
"github.com/aweris/gale/daggerverse/actions/runtime@e0f087ca2b2b6cb2e2cb2360e497c7e19c2b9365"
]
}
2 changes: 1 addition & 1 deletion daggerverse/gha/trufflesecurity/trufflehog/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/99designs/gqlgen v0.17.31
github.com/Khan/genqlient v0.6.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/sync v0.3.0
golang.org/x/sync v0.4.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions daggerverse/gha/trufflesecurity/trufflehog/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq
github.com/vektah/gqlparser/v2 v2.5.6/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
9 changes: 6 additions & 3 deletions daggerverse/gha/trufflesecurity/trufflehog/main.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc4664c

Please sign in to comment.