Skip to content

Commit 5192ca0

Browse files
committed
fix(entrypoint): handle runner exit and cleanup
- Captures the exit code of the runner process for better error handling. - Performs cleanup operations after the runner finishes execution. - Exits the script with the same exit code as the runner to maintain the expected behavior.
1 parent 6a39eb6 commit 5192ca0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,16 @@ main() {
194194

195195
# Wait for the runner process
196196
wait $RUNNER_PID
197+
RUNNER_EXIT_CODE=$?
198+
199+
echo "Runner process exited with code: $RUNNER_EXIT_CODE"
200+
201+
# Clean up the runner registration
202+
echo "Performing cleanup..."
203+
cleanup_runner
204+
205+
# Exit with the same code as the runner
206+
exit $RUNNER_EXIT_CODE
197207
}
198208

199209
# Execute main function

0 commit comments

Comments
 (0)