How to make sure a workflow has succeeded from another workflow


I’m trying to set up GitHub Actions CI + a Publish to npm step here:

CI should work, but being I have the publish workflow on a separate file, is it possible to require the Tests workflow to pass before even trying to run the publish workflow?

Thanks in advance!

A common setup is to have the test workflow run whenever a PR is created and the publish workflow to run when the PR is merged against your main branch (usually master). Combined with branch protection rules, you can assure that a PR is only mergeable when the test workflow was successful.


You may be able to use needs

It seems needs only works for jobs? Here I want to make sure another workflow is passing.

Does anyone know?
I also want to know how to check another workflow status :thinking: