Telefonica / puppet-github-actions-runner

In This Repository you can find a module that will setup all of the files and configuration needed for GitHub Actions runner to work on Linux hosts (Ubuntu, Debian and CentOS).
Apache License 2.0
12 stars 15 forks source link

Customise environment variables per-runner #39

Closed danmilleruk closed 2 years ago

danmilleruk commented 2 years ago

Currently there is no option to configure environment variables on a per-runner basis. There are few instances where this is needed, but this is still greater than zero.

It would be great if we could pass environment variables to be written to .env on each runner.

This will also eventually be useful to customise the (currently in BETA) "ACTIONS_RUNNER_HOOK_JOB_STARTED" and "ACTIONS_RUNNER_HOOK_JOB_COMPLETED" environment variables, for running cleanup scripts, etc.

mrodm commented 2 years ago

Hi! Thanks for reporthing this issue.

This feature looks quite useful so runners can be further customized at host level if necessary. We'll take a look to it.

I guess it could be implemented using a similar logic to PR #37, and I've created this PR for this issue: #40

As a reference, here I found the documentation about those environment variables and how they should be added into .env file: