feat: output build ID, number, and status from push action#18
Conversation
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
| **build-id**: ID of the Actor build triggered by the push. | ||
|
|
||
| **build-number**: Version number of the Actor build. | ||
|
|
||
| **build-status**: Status of the Actor build (e.g. `SUCCEEDED`, `FAILED`). |
There was a problem hiding this comment.
Will the action still pass (will CLI return 0 exit code), if the build fails?
There was a problem hiding this comment.
It depends on the CLI implementation. The apify push command waits for the build to complete, so if the build fails the CLI should exit non-zero — causing the step to fail before outputs are even set. The build-status output is primarily useful for builds that finish with a non-fatal status (e.g. SUCCEEDED vs a partial state). Worth verifying against the actual CLI behavior once apify-cli#1025 lands.
There was a problem hiding this comment.
well duh.
I just checked the CLI implementation, passing the --json flag actually changes the behaviour (without --json the process exits with 1 if the build is failing; with --json, it returns early). This means we'll need to check the status manually here to keep BC.
@copilot please prepare a commit failing the action if the status is not SUCCEEDED.
There was a problem hiding this comment.
Done in 8f066da — after parsing the JSON, the status is checked and the step exits with 1 (plus a ::error:: annotation) if it's anything other than SUCCEEDED.
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
|
Note for humans: we have to wait for the CLI release first landing this PR, only then we can merge this. |
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
outputssection toaction.yamlwithbuild-id,build-number,build-statusoutputs--jsonflag and set outputs from parsed responseSUCCEEDEDapify-clito1.3.0(first version supportingapify push --json)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.