Hi,
yesterday I created a POC Java program named Action.java
handling the logic of an Action run.
Find the template repository here: https://github.com/sormuras/hello-world-java-action
It is based on the composite run steps action. An action.yml
with runs: using: "composite"
delegates via JEP 330 the thread of execution to a Java program.
Inputs of the Action are passed as command line arguments – but could also be set as system properties via -Dinputs.who-to-greet=${{ inputs.who-to-greet }}
. The standard output stream (java.lang.System.out
) is used to set output values of the Action.
What do you think? Is it useful? Perhaps a candidate to be added to the list of supported types of actions?
Caveats:
- Requires that Java (JDK 11 or later) is pre-installed on every hosted runner and an environment variable with name
JAVA_HOME_11_X64
points to its installation directory. - The current
action.yml
parser is used as the glue to invokeAction.java
and it expects to find a::set-output name=random-id::...
for each input within theaction.yml
file.