From 525ed48c503013d9403b649cfab1912a18e25ce3 Mon Sep 17 00:00:00 2001 From: Ali AKCA Date: Fri, 27 Oct 2023 13:37:07 +0200 Subject: [PATCH] feat: add hello-world-javascript-action dagger module --- .../hello-world-javascript-action/.gitignore | 3 ++ .../hello-world-javascript-action/dagger.json | 7 ++++ .../hello-world-javascript-action/go.mod | 15 +++++++ .../hello-world-javascript-action/go.sum | 35 ++++++++++++++++ .../hello-world-javascript-action/main.go | 41 +++++++++++++++++++ go.work | 1 + 6 files changed, 102 insertions(+) create mode 100644 daggerverse/gha/actions/hello-world-javascript-action/.gitignore create mode 100644 daggerverse/gha/actions/hello-world-javascript-action/dagger.json create mode 100644 daggerverse/gha/actions/hello-world-javascript-action/go.mod create mode 100644 daggerverse/gha/actions/hello-world-javascript-action/go.sum create mode 100644 daggerverse/gha/actions/hello-world-javascript-action/main.go diff --git a/daggerverse/gha/actions/hello-world-javascript-action/.gitignore b/daggerverse/gha/actions/hello-world-javascript-action/.gitignore new file mode 100644 index 00000000..d10f24a6 --- /dev/null +++ b/daggerverse/gha/actions/hello-world-javascript-action/.gitignore @@ -0,0 +1,3 @@ +/dagger.gen.go +/internal/querybuilder/ +/querybuilder/ diff --git a/daggerverse/gha/actions/hello-world-javascript-action/dagger.json b/daggerverse/gha/actions/hello-world-javascript-action/dagger.json new file mode 100644 index 00000000..e034fe7e --- /dev/null +++ b/daggerverse/gha/actions/hello-world-javascript-action/dagger.json @@ -0,0 +1,7 @@ +{ + "name": "hello-world-javascript-action", + "sdk": "go", + "dependencies": [ + "github.com/aweris/gale/daggerverse/actions/runtime@01999763545556511d53a8649fb66ffe4e977d8f" + ] +} diff --git a/daggerverse/gha/actions/hello-world-javascript-action/go.mod b/daggerverse/gha/actions/hello-world-javascript-action/go.mod new file mode 100644 index 00000000..c7f67ff4 --- /dev/null +++ b/daggerverse/gha/actions/hello-world-javascript-action/go.mod @@ -0,0 +1,15 @@ +module hello-world-javascript-action + +go 1.21 + +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 +) + +require ( + github.com/stretchr/testify v1.8.3 // indirect + github.com/vektah/gqlparser/v2 v2.5.6 // indirect +) diff --git a/daggerverse/gha/actions/hello-world-javascript-action/go.sum b/daggerverse/gha/actions/hello-world-javascript-action/go.sum new file mode 100644 index 00000000..4551ee79 --- /dev/null +++ b/daggerverse/gha/actions/hello-world-javascript-action/go.sum @@ -0,0 +1,35 @@ +github.com/99designs/gqlgen v0.17.31 h1:VncSQ82VxieHkea8tz11p7h/zSbvHSxSDZfywqWt158= +github.com/99designs/gqlgen v0.17.31/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= +github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk= +github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq8cRU= +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= +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= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/daggerverse/gha/actions/hello-world-javascript-action/main.go b/daggerverse/gha/actions/hello-world-javascript-action/main.go new file mode 100644 index 00000000..b15d7bfd --- /dev/null +++ b/daggerverse/gha/actions/hello-world-javascript-action/main.go @@ -0,0 +1,41 @@ +// Code generated by gha2dagger. DO NOT EDIT. + +package main + +// HelloWorldJavascriptAction represents the GitHub action. Greet someone and record the time +type HelloWorldJavascriptAction struct{} + +func (m HelloWorldJavascriptAction) Run( + // Who to greet + withWhoToGreet Optional[string], + // The directory containing the repository source. If source is provided, rest of the options are ignored. + source Optional[*Directory], + // The name of the repository. Format: owner/name. + repo Optional[string], + // Tag name to check out. Only one of branch or tag can be used. Precedence is as follows: tag, branch. + tag Optional[string], + // Branch name to check out. Only one of branch or tag can be used. Precedence is as follows: tag, branch. + branch Optional[string], + // Image to use for the runner. + runnerImage Optional[string], + // Enables debug mode. + runnerDebug Optional[bool], + // GitHub token to use for authentication. + token Optional[*Secret], +) *Container { + // initializing runtime options + opts := ActionsRuntimeRunOpts{ + Branch: branch.GetOr(""), + Repo: repo.GetOr(""), + RunnerDebug: runnerDebug.GetOr(false), + RunnerImage: runnerImage.GetOr(""), + Source: source.GetOr(nil), + Tag: tag.GetOr(""), + Token: token.GetOr(nil), + } + + return dag.ActionsRuntime(). + Run("actions/hello-world-javascript-action@main", opts). + WithInput("who-to-greet", withWhoToGreet.GetOr("World")). + Sync() +} diff --git a/go.work b/go.work index 47731794..4b3d965c 100644 --- a/go.work +++ b/go.work @@ -4,6 +4,7 @@ use ( common daggerverse/actions/runtime daggerverse/gale + daggerverse/gha/actions/hello-world-javascript-action daggerverse/gha/trufflesecurity/trufflehog daggerverse/repo daggerverse/source