Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit bbcb470

Browse files
authored
fix: remove job start hook with senstive information (#3986)
Remove not used job web ook that was logging potential sensitive information. close #3980
1 parent 1095c92 commit bbcb470

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

Diff for: modules/runners/templates/start-runner.sh

-30
Original file line numberDiff line numberDiff line change
@@ -80,38 +80,8 @@ cleanup() {
8080
fi
8181
}
8282

83-
set_job_hook() {
84-
local job_hook_script="$1"
85-
local job_hook_var_name="$2"
86-
87-
if [[ -f "$job_hook_script" ]]; then
88-
echo "$job_hook_script exists - $job_hook_script"
89-
echo "$job_hook_var_name=$job_hook_script" | tee -a /opt/actions-runner/.env
90-
else
91-
echo "$job_hook_script does not exist - $job_hook_script"
92-
fi
93-
}
94-
95-
create_job_start_hook_script() {
96-
cat <<EOF > /opt/actions-runner/job_pre_start_hook.sh
97-
#!/bin/bash
98-
echo "Running job pre start hook"
99-
env
100-
echo ------
101-
ls -la /opt/actions-runner/_work/_temp/_github_workflow
102-
cat /opt/actions-runner/_work/_temp/_github_workflow/event.json
103-
104-
EOF
105-
chmod +x /opt/actions-runner/job_pre_start_hook.sh
106-
}
107-
10883
trap 'cleanup $? $LINENO $BASH_LINENO' EXIT
10984

110-
create_job_start_hook_script
111-
JOB_PRE_HOOK_SCRIPT=/opt/actions-runner/job_pre_start_hook.sh
112-
set_job_hook $JOB_PRE_HOOK_SCRIPT ACTIONS_RUNNER_HOOK_JOB_STARTED
113-
114-
11585
echo "Retrieving TOKEN from AWS API"
11686
token=$(curl -f -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 180" || true)
11787
if [ -z "$token" ]; then

0 commit comments

Comments
 (0)