File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 33export RUNNER_ALLOW_RUNASROOT=1
44export PATH=$PATH :/actions-runner
55
6+ # Un-export these, so that they must be passed explicitly to the environment of
7+ # any command that needs them. This may help prevent leaks.
8+ export -n ACCESS_TOKEN
9+ export -n RUNNER_TOKEN
10+
611deregister_runner () {
712 echo " Caught SIGTERM. Deregistering runner"
8- _TOKEN=$( bash /token.sh)
9- RUNNER_TOKEN=$( echo " ${_TOKEN} " | jq -r .token)
13+ if [[ -n " ${ACCESS_TOKEN} " ]]; then
14+ _TOKEN=$( ACCESS_TOKEN=" ${ACCESS_TOKEN} " bash /token.sh)
15+ RUNNER_TOKEN=$( echo " ${_TOKEN} " | jq -r .token)
16+ fi
1017 ./config.sh remove --token " ${RUNNER_TOKEN} "
1118 exit
1219}
5360
5461configure_runner () {
5562 if [[ -n " ${ACCESS_TOKEN} " ]]; then
56- echo " Obtaining the token of the runner "
57- _TOKEN=$( bash /token.sh)
63+ echo " Obtaining the token of the runnet "
64+ _TOKEN=$( ACCESS_TOKEN= " ${ACCESS_TOKEN} " bash /token.sh)
5865 RUNNER_TOKEN=$( echo " ${_TOKEN} " | jq -r .token)
5966 fi
6067
@@ -101,8 +108,5 @@ if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
101108 trap deregister_runner SIGINT SIGQUIT SIGTERM
102109fi
103110
104- unset ACCESS_TOKEN
105- unset RUNNER_TOKEN
106-
107111# Container's command (CMD) execution
108112" $@ "
You can’t perform that action at this time.
0 commit comments