import "@com.github.actions.contrib/ActionGenerator.pkl"
local generator: ActionGenerator = new { actionName = "actions/checkout@v5" }
// The resulting action's Pkl source code, in text form.
local generatedActionPkl = generator.result
CLI usage
There is a helper to generate this action from the CLI;
see generate-action.pkl.
Using within a project
If generating a package within a project, the githubActionsPackageName property needs to be set.
This needs to be the simple name of the dependency that maps to package coordinate
package://pkg.pkl-lang.org/pkl-pantry/com.github.actions.
For example:
import "@com.github.actions.contrib/ActionGenerator.pkl"
local generator: ActionGenerator = new {
actionName = "actions/checkout@v5"
githubActionsPackageName = "com.github.actions"
}
Returns the relative, descendent directory path between this module and other.
Throws if no such path exists.
For example, if module mod1 has path /dir1/mod1.pkl, and module mod2 has path
/dir1/dir2/dir3/mod2.pkl, then mod1.relativePathTo(mod2) will return
List("dir2", "dir3").
A common use case is to compute the directory path between a template located at the root of a
hierarchy (say rootModule.pkl) and the currently evaluated module (accessible via the
module keyword):
Utility library for generating a TypedStep given an action definition.