Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch Changes from Origin #77

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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