Required checks not passing for reusable workflows
Describe the bug Required checks do not pass for reusable workflows
To Reproduce Steps to reproduce the behavior:
- Create a status check for a job name (ie
pipeline) - Create a reusable workflow with a job similar to the required check (ie.
pipeline) - Create a new workflow using the reusable workflow
Expected behavior The required status check should acknowledge the workflow run
Runner Version and Platform
Version of your runner? 2.292.0
OS of the machine running the runner? Linux
What's not working?
The workflow runs but the required check is still waiting:

The required check is docker. The job in the reusable workflow is docker. The job that calls the reusable workflow is docker.
I just got into this problem today, the reusable workflow seems to have name constructed as <parent_job_name> / <reusable_workflow_name> but when I want to use that for status check it is not possible to find it
I just got into this problem today, the reusable workflow seems to have name constructed as
<parent_job_name> / <reusable_workflow_name>but when I want to use that for status check it is not possible to find it
How were you able to resolve that?
I think the problem is with the events on the workflow. Github is detecting status checks only if the workflow has a on: pull_request event. The way around would be moving the reusable workflow to a reusable action and then adding it to a workflow with a job_id as the status check name.
Same story, I have two different workflows for different head branches, so how should I add them to Status checks that are required.?
I think this should just not be configured in the UI (which has a terrible UX by the way), but be configurable in the yml file. I also think that by default all checks should be required that run as part of the PR. The only reason we configure the required check is because it's a prerequisite for having the check that makes sure the branch is up-to-date (and I don't understand why this prerequisite is there at all...).
I my case it was because I was using a job name and the branch name with a variable(github was showing the job name in the rules tab). After I removed the name It worked ok
Ran into this too. Why is it not possible to have reusable workflow as a requirement check for merging into master? This is absolutely basic functionality. Why then even have reusable workflows when I can just shove it all into one insanely huge yAML to work around this?
🤦♂️ I am regretting ever having to use github actions. We can now write a book about how terrible it is.
Is this bug still not resolved? Do y'all know any workaround besides just turning those required checks off? I think @dvj1988 might've had something here although in our case, we actually containerize our CICD with our own Docker images so we have to use re-usable workflows instead of actions.
Actually I may have a workaround for y'all. Instead of configure multiple required checks using re-usable workflows, add a final step (e.g. name: CI Workflow Status) that collects all the previous workflow statuses using GHA plugin martialonline/workflow-status@v4 and don't use a re-usable workflow for that step.
In the repo branch protection rule, configure only that step CI Workflow Status in the required checks. This step basically will fail if any of the dependencies fails and will succeed and allows to merge if every step before succeeds.
Just a few more lines of code in the script with no major overhaul but at least it resolves the required checks being stuck. Hope this helps!
No fix yet? 1 year birthday on May 26th.
We were able to fix this by making sure the call to the reusable workflow follow the "actions" syntax: {org}/{repo}/.github/workflow/action.yaml@master just ensure your GITTOKEN has access to the local repos, as an example. If we tried to call the action/workflow locally .github/worksflows/etc.... it matched what @adrielldagasuan posted above. Why this works I have no idea but it solved our issue. You can also self reference your own workflow locally if you don't store your global actions in a separate repo
I think we have this issue too. Any updates from the Github team?
Have the same issue. Any updates?
same issue here :\
@LuWang1983 thanks for workaround!
A simpler workaround is to have a follow-up job that depends on the reusable workflow and mirrors its results. Here's a complete example:
name: My workflow
on:
pull_request:
branches:
- main
jobs:
run-reusable-workflow:
uses: myorg/reusable-workflow-library/.github/workflows/awesome-workflow-v1.yaml@main
check-result:
needs: run-reusable-workflow
if: always()
runs-on: ubuntu-latest
steps:
- run: exit ${{ needs.run-reusable-workflow.result != 'success' && '1' || '0' }}
This works pretty well for us.
If someone needs follow-up job to pass in case dependent is skipped, here's how I check it:
name: My workflow
on:
pull_request:
branches:
- main
jobs:
run-reusable-workflow:
uses: myorg/reusable-workflow-library/.github/workflows/awesome-workflow-v1.yaml@main
check-result:
needs: run-reusable-workflow
if: always()
runs-on: ubuntu-latest
steps:
- run: exit 1
if: ${{ contains(fromJSON('["failure", "cancelled"]'), needs.run-reusable-workflow.result) }}