I have a script that pushes a tag, and then immediately calls actions-cli to watch the deploy workflow triggered on: create of that tag.
Right now, I need to insert a sleep in my script, because without it, actions-cli just finds the newest existing run (the one from the last deploy), shows it, and exits.
Although my tag has already been pushed, the relevant workflow-run gets created asynchronously on Github's side, and it seemingly takes a few seconds. So if I invoke actions-cli right away, the new run isn't available yet. Instead, it just sees the old runs, and assumes I wanted to see the newest of those.
But of course, I actually want to see the new run; and if hasn't been created yet, I want actions-cli to wait around until it does get created, and then show its progress.
Proposed fix
- Add a timestamp-valued switch to
actions-cli, which will tell it to ignore or avoid matching any workflow-runs that were created before the passed timestamp.
- Add a boolean switch, to tell
actions-cli that if it fails to discover any non-ignored runs (as could happen with the above time-filter in place), it should not exit, but rather should poll the workflow-runs API endpoint until it does successfully find a workflow run that passes the filter.
With these two switches together, I wouldn't need the sleep in my script; instead, I could run e.g. actions-cli --runs-since=... --block-until-found, and it would just sit there until a new workflow-run starts, at which point it would then start logging the progress of that workflow-run.
I have a script that pushes a tag, and then immediately calls
actions-clito watch the deploy workflow triggeredon: createof that tag.Right now, I need to insert a
sleepin my script, because without it,actions-clijust finds the newest existing run (the one from the last deploy), shows it, and exits.Although my tag has already been pushed, the relevant workflow-run gets created asynchronously on Github's side, and it seemingly takes a few seconds. So if I invoke
actions-cliright away, the new run isn't available yet. Instead, it just sees the old runs, and assumes I wanted to see the newest of those.But of course, I actually want to see the new run; and if hasn't been created yet, I want
actions-clito wait around until it does get created, and then show its progress.Proposed fix
actions-cli, which will tell it to ignore or avoid matching any workflow-runs that were created before the passed timestamp.actions-clithat if it fails to discover any non-ignored runs (as could happen with the above time-filter in place), it should not exit, but rather should poll the workflow-runs API endpoint until it does successfully find a workflow run that passes the filter.With these two switches together, I wouldn't need the
sleepin my script; instead, I could run e.g.actions-cli --runs-since=... --block-until-found, and it would just sit there until a new workflow-run starts, at which point it would then start logging the progress of that workflow-run.