actionforge / graph-runner

🏃‍♀️ The core cli of Actionforge
Other
12 stars 0 forks source link

Fix actions with docker images and isolate env variables #25

Closed sebastianrath closed 5 months ago

sebastianrath commented 5 months ago

This PR fixes #23 and #24.

The former issue is caused by a missing support of docker file actions. Until now only actions that pull from a container registry are supported, while some actions come with a dockerfile that needs to be built locally instead of pulling.

The latter issue was the result of some refactoring of the docker support. It is now very well defined which nodes have access to which environment variables (including PATH). They are now attached to the execution context and subsequent nodes have now access to environment variables either modified or simply funnelled through by previous nodes/actions. Nodes that can modify the environment variables are GitHub Action nodes and the Run node using GITHUB_ENV and GITHUB_PATH.

echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "{environment_variable_name}={value}" >> "$GITHUB_ENV"

Each context highlighted by green and red here.

In the example below, the nodes Setup Node.js environment modify the environment variables. Each subsequent call to their next node will inherit these environment variables respectively.

update