Since the action
class is just a wrapper over @actions/core
, just simply call the same methods as you would if you were using the @actions/core
functions.
Currently implemented functions:
- Use
action.getInput()
to replacecore.getInput()
- Use
action.setOutput()
to replacecore.setOutput()
- Use
action.info()
to replacecore.info()
- Use
action.error()
to replacecore.error()
- Use
action.warning()
to replacecore.warning()
- Use
action.setFailed()
to replacecore.setFailed()
Example Environment File:
{
"environment": "",
"my-var-1": "",
"my-var-2": "",
}
Below are some situations that will treat the action as if it is in a production environment.
- The env.json file does not exist.
- The environment key does not exist.
- The environment key is not a string type
- The environment key is empty, null, or undefined
The following environment values are acceptable for a development environment.
- dev
- develop
The following environment values are acceptable for a production environment.
- prod
- production
- ""
- null
- undefined