chromaui/chromatic-cli

Github Action `buildUrl` output is undefined when skipping rebuild

Opened this issue ยท 3 comments

samtjo commented

Bug report

When the Chromatic Github Action is re-run on a commit with a fully passed/accepted build and the rebuild is skipped, the buildUrl output is set to undefined. I would have expected this to be the URL of the build for that commit, would it be possible to fix that please?

This is needed for a Collibra project and we are customers of Chromatic, just mentioning as I saw the "Customer reported" label on some of the other issues.

Thanks! ๐Ÿ˜„

See an example of the terminal output for the skipped rebuild below:

Run chromaui/action@v1

Chromatic CLI v6.19.9
https://www.chromatic.com/docs/cli

Authenticating with Chromatic
    โ†’ Connecting to https://index.chromatic.com/
Authenticated with Chromatic
    โ†’ Using project token '************'
Retrieving git information
Skipping build
    โ†’ Skipping rebuild of an already fully passed/accepted build
โ„น Skipping rebuild of an already fully passed/accepted build
A build for the same commit as the last build on the branch is considered a rebuild.
If the last build is passed or accepted, the rebuild is skipped because it shouldn't change anything.
You can override this using the --force-rebuild flag.

Hi @samtjo! This is currently working as we intended. If a new build is not created, we do not set this field since their is no actual build for this CI run. What workflow is your team using with the buildUrl?

rathpc commented

Hi @samtjo! This is currently working as we intended. If a new build is not created, we do not set this field since their is no actual build for this CI run. What workflow is your team using with the buildUrl?

Wouldn't it make sense if the script is able to determine that it has already been built to simply return the url from the last built run?

That way If subsequent jobs or steps are relying on that value it will still succeed even if a rebuild wasn't required? This would be the case as well if a workflow was rerun but was built successfully the first time around.

samtjo commented

Thanks for the fast response @thafryer!

What Steven said ^^^ (for context we work together on the same team). If the script is already identifying that there's a build for the same commit on the same branch, wouldn't it make sense to set the buildUrl to point at that build?