schutzbot: keep runners alive when users are logged on

For troubleshooting in CI, if a user is logged on to a runner, keep it
alive until they are logged off.
This commit is contained in:
Achilleas Koutsou 2022-02-21 15:01:31 +01:00 committed by Ondřej Budai
parent cf8f05b57c
commit e869c6ab84

View file

@ -6,6 +6,12 @@ if [[ "$CI_PIPELINE_SOURCE" == "schedule" ]]; then
exit 0
fi
# if a user is logged in to the runner, wait until they're done
while (( $(who -s | wc -l) > 0 )); do
echo "Waiting for user(s) to log off"
sleep 30
done
if [[ $1 == "start" ]]; then
GITHUB_NEW_STATE="pending"
GITHUB_NEW_DESC="I'm currently testing this commit, be patient."