actions / actions/actions-runner-controller

Document job hook scripts

Open
#3,558 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

community enhancement needs triage
Dominant language
Go
Stars
6.5k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
27

Description

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
  • You can see here how one person tripped over this confusing documentation, preventing the installed scripts from being executed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading runner/startup.sh and the job-started.sh and job-completed.sh hook scripts linked in the issue. Verify how the environment variables interact with the existing hooks directories, then document the trade-offs and the /etc/arc/hooks/job-started.d/ and /etc/arc/hooks/job-completed.d/ alternatives. Done means users can choose an approach without unintentionally disabling installed scripts.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, kubernetes, shell
Domain
devops, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.