Makefile non-zero exit code still marked as succeeded

I have set up a GitHub Actions workflow to run a Makefile that returns a non-zero exit code and yet the workflow is still marked as “succeeded”.

This workflow should fail on build (24.5…25.3) with exit code 2, as it does locally; all builds are marked succeeded, despite the error:

Any ideas?

@rnkn,

You can try using different shells to execute the “Run tests” step in your workflow, to see if the error can make the step be failed.
For example:

- name: Run tests
  shell: powershell  # or other shells such as 'cmd', 'pwsh', etc.
  run: make

In addition, I noticed you have deleted the branch “CI-should-fail-25” from your repository, and we can’t check more details of the source code from that branch.
If possible, please share a simple demo that can reproduce the problem you report so that we can view more detailed configurations.

1 Like

Thanks for the hints. I had tried specifying shell: bash and a few other suggestions on these forums with no success. It all seemed much harder than it should be so I ended up going with a drop-in replacement from the marketplace, which worked.

1 Like

@rnkn,

Glad that the problem has been solved.
If you have any other question about this ticket, feel free to contact us.