Skip to content

Commit 278a46b

Browse files
committed
runner-cleanup: give job-completed hook a .sh extension
The GitHub runner validates ACTIONS_RUNNER_HOOK_JOB_COMPLETED and rejects it in the 'Complete runner' step unless the path ends in .sh/.ps1/.js: Error: /usr/local/sbin/runner-job-completed is not a valid path to a script. Make sure it ends in '.sh', '.ps1' or '.js'. Rename runner-job-completed -> runner-job-completed.sh, install it under that name, point the per-runner .env at it, and remove the old extensionless copy from earlier installs. The .env wiring is an idempotent sed, so re-running install migrates existing runners to the new path. Signed-off-by: Igor Pecovnik <igor@armbian.com>
1 parent ea4137a commit 278a46b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

tools/modules/system/module_armbian_runners.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ function module_armbian_runners () {
203203
# cleanup. The runner runs this after every job via
204204
# ACTIONS_RUNNER_HOOK_JOB_COMPLETED (wired into each
205205
# runner's .env below).
206-
install -m 0755 "${cleanup_src}/runner-job-completed" /usr/local/sbin/runner-job-completed
206+
# The GitHub runner validates the hook path and rejects it
207+
# unless it ends in .sh/.ps1/.js, so the installed name keeps
208+
# the .sh extension. Remove the old extensionless copy left by
209+
# earlier installs.
210+
install -m 0755 "${cleanup_src}/runner-job-completed.sh" /usr/local/sbin/runner-job-completed.sh
211+
rm -f /usr/local/sbin/runner-job-completed
207212
systemctl daemon-reload
208213
# Don't silence errors here — a failed timer install
209214
# means the cleanup never fires and the host quietly
@@ -233,7 +238,7 @@ function module_armbian_runners () {
233238
# passwordless sudo) after each job. Idempotent; covers
234239
# already-installed runners too. Takes effect on each runner's
235240
# next (re)start, so we don't force-restart busy ones here.
236-
local job_hook_path="/usr/local/sbin/runner-job-completed"
241+
local job_hook_path="/usr/local/sbin/runner-job-completed.sh"
237242
local runner_home runner_owner env_file
238243
for runner_home in /home/actions-runner-*; do
239244
[[ -d "$runner_home" ]] || continue

tools/modules/system/runner-cleanup/runner-job-completed renamed to tools/modules/system/runner-cleanup/runner-job-completed.sh

File renamed without changes.

0 commit comments

Comments
 (0)