actions / actions-runner-controller

Kubernetes controller for GitHub Actions self-hosted runners

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document job hook scripts

Nuru opened this issue · comments

commented

What would you like added?

The GitHub Docs document hooks to configure scripts to run before or after a job, by setting environment variables that point to scripts to run. This would suggest people could set and use those variables directly. However, the runner is already using them:

export ACTIONS_RUNNER_HOOK_JOB_STARTED=/etc/arc/hooks/job-started.sh
export ACTIONS_RUNNER_HOOK_JOB_COMPLETED=/etc/arc/hooks/job-completed.sh

It is unclear what the consequences would be of setting the environment variables to some other value, and thus not executing the expected scripts.

Furthermore, the provided scripts already provide a different mechanism for adding scripts to run,
/etc/arc/hooks/job-started.d/ and /etc/arc/hooks/job-completed.d/, but that is not documented anywhere.

Why is this needed?

Following the current documentation results in unexpected and undocumented loss of features. Adequate documentation would explain the trade-offs of losing these features and offer the alternative of adding scripts to the relevant directory.

Additional context

  • You can see here how one person tripped over this confusing documentation, preventing the installed scripts from being executed.