chromatic-cli icon indicating copy to clipboard operation
chromatic-cli copied to clipboard

Fix usage in reused workflows

Open haschek opened this issue 2 years ago • 3 comments

If the chromaui/action is used inside a reused workflow by the workflow_call event then it looks like your condition tests for the context of the parent workflow.

This leads to a failed workflow step "Error: When triggering via workflow_dispatch, ref & sha are required inputs." even if ref/sha context is available in the reused workflow.

Use case

"Workflow A" creates tags for release candidates triggered by manual workflow_dispatch event, then it calls "Workflow B" to publish packages and deploy storybooks for those tag refs.

Problem

In "Workflow B" the ref and sha context is available but chromaui/action fails because "Workflow A" is triggered by workflow_dispatch.

Expected

chromaui/action is working on the known context about ref & sha.

Example

Here are two of our Github workflows implementing the described use case:

Possible solution

When the correct context of the action and the workflow cannot be tested then maybe the addition of explicit parameters for ref & sha could do the job.

haschek avatar Mar 22 '22 16:03 haschek

Thanks for the feature request @haschek, we'll take a look when we can! If you'd like to send a PR to change it, that would be even better ;)

tmeasday avatar Mar 23 '22 02:03 tmeasday

@tmeasday

To be honest, I would consider this not as feature request, because there is no request for new functionality. Imho it is a bug report because I would expect that chromaui/action is working inside a workflow with a given context of ref & sha.

I understand that it would better to provide a PR to solve this problem but currently I don't even know how to develop and test an Github action locally. I always open to test feature branches, RCs, etc ...

haschek avatar Mar 23 '22 14:03 haschek

Sure thing @haschek!

I understand that it would better to provide a PR to solve this problem but currently I don't even know how to develop and test an Github action locally. I always open to test feature branches, RCs, etc ...

No problem, this is a commercial product after all, there is absolutely no expectation of this ;)

tmeasday avatar Mar 24 '22 01:03 tmeasday