App-Actions
view release on metacpan or search on metacpan
them. Commands, environment variables and secrets are passed to Docker as
bytes (UTF-8 for text from the workflow). What the containers print is
passed through to your terminal unchanged. Messages from this module are
in English unless `ACTION_RUN_LANG` chooses French (`fr`), German
(`de`) or Chinese (`zh`); those are character strings, so the terminal
should use UTF-8. Settings in configuration files and `App__Actions__*`
environment variables are used as [Config::Abstraction](https://metacpan.org/pod/Config%3A%3AAbstraction) reads them; keep
option values there in ASCII.
## See Also
- [Configure an Object at Runtime](https://metacpan.org/pod/Object%3A%3AConfigure), which ["new"](#new)
uses to read configuration files and environment variables
- [Config::Abstraction](https://metacpan.org/pod/Config%3A%3AAbstraction), which finds and reads those files
- [Test Dashboard](https://nigelhorne.github.io/App-Actions/coverage/)
## Author
Nigel Horne, `<njh at nigelhorne.com>`
## Formal Specification
This section describes each routine in the Z notation, a precise
mathematical language for describing programs. You do not need to read it
to use the module: everything here is also said in plain words in the
sections above. It is for readers who want to check exactly what a routine
promises.
How to read it: a box names a routine. The lines above the middle rule
declare the values it works with. A name ending in `?` is an input, and a
name ending in `!` is an output. `ÎState` means the routine changes
nothing, and `ÎState` means it can change the state. The lines below the
rule are the conditions that are always true when the routine returns.
### New
```
ââ New âââââââââââââââââââââââââââââââââââââââââââââ
â ÎFileSystem
â workflowFile? : optional PATH
â projectDir? : optional PATH
â options? : OPTION ⸠VALUE
â actions! : Actions
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom options? â RUNNER_OPTIONS
â let settings == (args? â fileConfig(App__Actions)) â envConfig(App__Actions__)
â where args? == options? ⪠{workflow_file ⦠workflowFile?, project_dir ⦠projectDir?}
â -- dom fileConfig and dom envConfig are not checked against RUNNER_OPTIONS
â workflowFile? = ⥠â raises WorkflowFileRequired
â abs(workflowFile?) â regularFiles â raises WorkflowFileMissing
â projectDir? = ⥠⧠abs(workflowFile?) â (PATH â "/.github/workflows/" â NAME)
â â raises ProjectDirRequired
â let root == (projectDir? â ⥠â abs(projectDir?))
â â§ (projectDir? = ⥠â repository(abs(workflowFile?)))
â root â directories â raises ProjectDirMissing
â actions!.workflow = Workflow.Load(abs(workflowFile?))
â actions!.project_dir = root
â actions!.options = settings
â let logged == (logger? â ⥠â logger?)
â â§ (logger? = ⥠⧠logger â dom configured â configured(logger))
â â§ (logger? = ⥠⧠logger â dom configured â stderrLogger)
â where configured == fileConfig(App__Actions) â envConfig(App__Actions__)
â -- fileConfig includes the UNIVERSAL section of universal.yaml
â actions!.logger â LogAbstraction
â logged = NULL â actions!.logger = silentLogger
â logged â NULL â actions!.logger = toLogger(logged)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
The workflowFile? and projectDir? above are the values in settings, so a
configuration file or environment variable can replace them too.
```
### Workflow, Workflow\_File, Project\_Dir
```
ââ Accessor ââââââââââââââââââââââââââââââââââââââââ
â ÎActions
â field? : {workflow, workflow_file, project_dir}
â value! : VALUE
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â value! = θActions.field?
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
```
### Run
```
ââ Run âââââââââââââââââââââââââââââââââââââââââââââ
â ÎActions
â overrides? : OPTION ⸠VALUE
â exit! : {0, 1, 2}
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom overrides? â RUNNER_OPTIONS
â exit! = Runner.Run(options â overrides?)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
```
### Preflight
```
ââ Preflight âââââââââââââââââââââââââââââââââââââââ
â ÎActions
â overrides? : OPTION ⸠VALUE
â json? : optional BOOLEAN
â result! : Result
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
â dom overrides? â RUNNER_OPTIONS
â result! = Runner.Preflight(options â overrides?, json?)
â result!.exit â {0, 2}
â json? â valid(result!.summary, PreflightSchema)
ââââââââââââââââââââââââââââââââââââââââââââââââââââ
```
### Json\_Schema
```
DOCUMENT ::= check | preflight | cache | logs
ââ JsonSchema ââââââââââââââââââââââââââââââââââââââ
â name? : optional STRING
â schema! : KEY ⸠VALUE
( run in 0.607 second using v1.01-cache-2.11-cpan-60884a8df76 )