github-action-wait-for-status icon indicating copy to clipboard operation
github-action-wait-for-status copied to clipboard

Add the feature to timeout after some time

Open juan-vg opened this issue 1 year ago • 7 comments

This could be useful to fail gracefully instead of indefinitely consuming the runner minutes

juan-vg avatar Jul 02 '24 12:07 juan-vg

Nevermind. I discovered this can be done natively from the workflow itself by using https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepstimeout-minutes

juan-vg avatar Jul 02 '24 12:07 juan-vg

It's not a bad idea actually. Using the native way will kill the process and (assuming) fail the workflow. But by letting this action handle that it can assume a green status after an X amount of seconds.

WyriHaximus avatar Jul 02 '24 13:07 WyriHaximus

@WyriHaximus in fact, for my case what I want/need is to fail after some time. As an example: for stuck CI stuff I don't want to waste runner minutes, but I also don't want to succeed if not completed successfully. Said that, yep, if what you want is to succeed after some time you can't do it natively, so you need to rely on the action to handle it.

juan-vg avatar Jul 02 '24 14:07 juan-vg

FYI: I can confirm the native timeout results in failure

juan-vg avatar Jul 02 '24 15:07 juan-vg

@juan-vg Would make both the timeout and the exit code (so success or failure) configurable work for you? Looking at adding this to 1.9 before overhauling internals in 1.10

WyriHaximus avatar Jul 02 '24 19:07 WyriHaximus

@WyriHaximus as I said, for my use-case the native way is just enough. However, I believe making those 2 parameters configurable will work for mostly all (if not all) use-cases

juan-vg avatar Jul 03 '24 13:07 juan-vg

@juan-vg Ok cool, just wanted to make sure your use case would be coverable by providing that from the action 👍 . You do you and use what works best for you.

WyriHaximus avatar Jul 08 '24 21:07 WyriHaximus