How to make sure a workflow has succeeded from another workflow

Hello!

I’m trying to set up GitHub Actions CI + a Publish to npm step here: https://github.com/fenneclab/hugo-bin/tree/master-xmr-actions/.github/workflows

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.

2 Likes

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: