Skip to content

Commit

Permalink
Merge pull request #77 from PerfectThymeTech/marvinbuss/fetch_changes…
Browse files Browse the repository at this point in the history
…_from_origin

Fetch Changes from Origin
  • Loading branch information
marvinbuss authored Jun 3, 2024
2 parents f914bcf + 89dcf66 commit c582c7e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/container/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ export -n RUNNER_TOKEN
export -n APP_ID
export -n APP_PRIVATE_KEY

trap_with_arg() {
func="$1" ; shift
for sig ; do
trap "$func $sig" "$sig"
done
}

deregister_runner() {
echo "Caught SIGTERM. Deregistering runner"
echo "Caught $1 - Deregistering runner"
if [[ -n "${ACCESS_TOKEN}" ]]; then
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
Expand Down Expand Up @@ -169,7 +176,7 @@ if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
fi

if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
trap_with_arg deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
fi

# Start docker service if needed (e.g. for docker-in-docker)
Expand Down

0 comments on commit c582c7e

Please sign in to comment.