Skip to content

Commit 42f38c8

Browse files
add note about restarting the runner service after changing the .env … (#35356)
Co-authored-by: Alex Nguyen <[email protected]>
1 parent b9191a7 commit 42f38c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

content/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ The scripts are automatically executed when the runner has the following environ
4949
* `ACTIONS_RUNNER_HOOK_JOB_STARTED`: The script defined in this environment variable is triggered when a job has been assigned to a runner, but before the job starts running.
5050
* `ACTIONS_RUNNER_HOOK_JOB_COMPLETED`: The script defined in this environment variable is triggered at the end of the job, after all the steps defined in the workflow have run.
5151

52-
To set these environment variables, you can either add them to the operating system, or add them to a file named `.env` within the self-hosted runner application directory (that is, the directory into which you downloaded and unpacked the runner software). For example, the following `.env` entry will have the runner automatically run a script, saved as `/opt/runner/cleanup_script.sh` on the runner machine, before each job runs:
52+
To set these environment variables, you can either add them to the operating system, or add them to a file named `.env` within the self-hosted runner application directory (that is, the directory into which you downloaded and unpacked the runner software). Note that any change to the `.env` file will require restarting the runner.
53+
For example, the following `.env` entry will have the runner automatically run a script, saved as `/opt/runner/cleanup_script.sh` on the runner machine, before each job runs:
5354

5455
```bash
5556
ACTIONS_RUNNER_HOOK_JOB_STARTED=/opt/runner/cleanup_script.sh

0 commit comments

Comments
 (0)