Interview Prep/GitHub Actions/Contexts, Expressions, Env & Outputs

What are `$GITHUB_STATE` and `$RUNNER_TEMP` used for?

AdvancedConceptContexts, Expressions, Env & Outputs
Answer

$GITHUB_STATE lets a JavaScript action's main script pass values to its own post script (available as STATE_<name> env), for example a temporary directory to clean up or a cache key to save. $RUNNER_TEMP is a temp directory emptied at the start and end of each job; use it for kubeconfigs, credentials files and scratch data rather than $GITHUB_WORKSPACE, which may be uploaded as an artifact or persist on self-hosted runners.

All GitHub Actions questions Roadmap: GitHub Actions

More on Contexts, Expressions, Env & Outputs