chromatic-cli
chromatic-cli copied to clipboard
Fix usage in reused workflows
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:
- Workflow A: .github/workflows/release-candidate.yml (we even set ref & sha here for context of the reused workflow)
- Workflow B: .github/workflows/release-publish.yml (chromaui/action is used in a step here)
- Error: https://github.com/eccenca/gui-elements/runs/5646753911?check_suite_focus=true
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.
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
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 ...
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 ;)