actions / actions-runner-controller

Kubernetes controller for GitHub Actions self-hosted runners
Apache License 2.0
4.76k stars 1.12k forks source link

Document job hook scripts #3558

Open Nuru opened 5 months ago

Nuru commented 5 months ago

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: https://github.com/actions/actions-runner-controller/blob/9afd93065fa8b1f87296f0dcdf0c2753a0548cb7/runner/startup.sh#L11-L12

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