Skip to content

feat: output build ID, number, and status from push action#18

Merged
barjin merged 6 commits into
masterfrom
copilot/add-build-id-output
Mar 13, 2026
Merged

feat: output build ID, number, and status from push action#18
barjin merged 6 commits into
masterfrom
copilot/add-build-id-output

Conversation

Copilot AI commented Feb 27, 2026

Copy link
Copy Markdown
Contributor
  • Add outputs section to action.yaml with build-id, build-number, build-status outputs
  • Modify push step to use --json flag and set outputs from parsed response
  • Update README to document the new outputs
  • Add example step in README that uses the action outputs
  • Fail the action with an error message if build status is not SUCCEEDED
  • Bump apify-cli to 1.3.0 (first version supporting apify push --json)
Original prompt

This section details on the original issue you should resolve

<issue_title>Output build ID / version</issue_title>
<issue_description>After building the Actor on Apify, we might want to reference the build in later steps. Returning the build ID / number / status from this action would definitely help with this.</issue_description>

<agent_instructions>use the issue description as well as the content of the comments to make changes to action.yml. make minimal changes that will result in this feature being implemented. be very concise, do not add excessive comments. use conventional commits for commit messages and PR titles.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@barjin update: https://github.com/apify/apify-cli/pull/1025 adds support for `--json` flag for `apify push` CLI command. When applied, the command will send the API response as described [here](https://docs.apify.com/api/v2/actor-build-get) to stdout.

We can pass some of this data to the Github Action outputs.</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add output for build ID and version feat: output build ID, number, and status from push action Feb 27, 2026

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please review my comments.

Comment thread README.md
Comment thread README.md
Comment thread README.md
Comment on lines +25 to +29
**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`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the action still pass (will CLI return 0 exit code), if the build fails?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@barjin

barjin commented Feb 27, 2026

Copy link
Copy Markdown
Member

Note for humans: we have to wait for the CLI release first landing this PR, only then we can merge this.

@barjin barjin marked this pull request as ready for review February 27, 2026 10:39
Comment thread action.yaml Outdated
Co-authored-by: barjin <61918049+barjin@users.noreply.github.com>
Copilot AI requested a review from barjin March 13, 2026 13:05
@barjin barjin merged commit abee865 into master Mar 13, 2026
1 check passed
@barjin barjin deleted the copilot/add-build-id-output branch March 13, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output build ID / version

4 participants