Skip to content

Commit

Permalink
Use better exit codes and comparison (actions#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerl authored Feb 24, 2022
1 parent ec98308 commit 6abef81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Misc/layoutroot/run-helper.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ elif [[ $returnCode == 1 ]]; then
elif [[ $returnCode == 2 ]]; then
echo "Runner listener exit with retryable error, re-launch runner in 5 seconds."
safe_sleep
exit 1
exit 2
elif [[ $returnCode == 3 ]]; then
# Sleep 5 seconds to wait for the runner update process finish
echo "Runner listener exit because of updating, re-launch runner in 5 seconds"
safe_sleep
exit 1
exit 2
elif [[ $returnCode == 4 ]]; then
# Sleep 5 seconds to wait for the ephemeral runner update process finish
echo "Runner listener exit because of updating, re-launch ephemeral runner in 5 seconds"
safe_sleep
exit 1
exit 2
else
echo "Exiting with unknown error code: ${returnCode}"
exit 0
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/layoutroot/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ while :;
do
"$DIR"/run-helper.sh $*
returnCode=$?
if [[ $returnCode == 1 ]]; then
if [[ $returnCode -eq 2 ]]; then
echo "Restarting runner..."
else
echo "Exiting runner..."
Expand Down

0 comments on commit 6abef81

Please sign in to comment.