Struggling to set continue-on-error, causing jobs to not start

I have a Matrix job set up, with a property entitled “required”, which is set to either “required” or “optional”

I want those jobs which are optional to still allow the workflow to continue on error.
Based on the documenattion, i’ve tried setting this:

continue-on-error: ${{ matrix.required }} == 'optional'

Which I believe should work, however while GitHub Actions isn’t complaing, those jobs that i’ve appended those lines to simply aren’t being triggered when they’re supposed to (I have a preliminary job running first). If I remove this line, the jobs trigger as expected.

What am I doing wrong?

Could you try setting the property like this:

continue-on-error: ${{ matrix.required == 'optional' }}

?

1 Like

that worked, thanks!

1 Like

It worked for me too! But this means that the documentation is wrong: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error

What exactly do you think is wrong in the documentation?

It says you should use

continue-on-error: ${{ matrix.experimental }}

But it doesn’t work: https://github.com/getsentry/sentry-symfony/actions/runs/285859307

Error when evaluating ‘continue-on-error’ for job ‘Tests’. (Line: 12, Col: 24): Unexpected value ‘’

The value/expression for if has to evaluate to a boolean and in the docs experimental is set to false. It all depends on what kind of values you use for your matrix.

1 Like