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).
#!/bin/bash
echo "Testing hooks added by means of .env file"
echo "Current directory"
pwd
That variable was read and loaded by the runner, and its executions appears in the step "Set up runner" in all workflows:
A job started hook has been configured by the self-hosted runner administrator
Run '/root/test.sh'
Testing hooks added by means of .env file
Current directory
/srv/actions-runner/repo/_work/repo/repo
As a note, according to the few tests I've carried out, if other variables are added to .env file, they cannot be used as an environment variable in Github workflows.
This PR adds the option to add customized environment variables per instance runner.
For instance, it could be used to add the environment variables mentioned in this doc to add cleanup scripts in runners.
Issue: https://github.com/Telefonica/puppet-github-actions-runner/issues/39
Adding as an example to the ".env" file the definition of the start hook
Content of /root/test.sh
That variable was read and loaded by the runner, and its executions appears in the step "Set up runner" in all workflows:
As a note, according to the few tests I've carried out, if other variables are added to .env file, they cannot be used as an environment variable in Github workflows.