-
Select Topic AreaQuestion BodyI have added required job that must pass for auto merge to trigger. Though because I have matrix of jobs (where number of jobs to be run can be different), its very clunky to specify matrix jobs as required. But the problem here is that "aggregate" job is skipped if previous job failed, yet auto merge is still triggered. Is this expected behavior? Cause I would expect auto merge to not trigger if required job was skipped? Setup looks like this: odoo:
needs: [versions]
if: ${{ needs.versions.outputs.names_comma != '' }}
strategy:
fail-fast: false
matrix:
version: "${{ fromJSON( needs.versions.outputs.names_json ) }}"
uses: ./.github/workflows/_odoo.yml
with:
version: ${{ matrix.version }}
secrets: inherit # pragma: allowlist secret
# This is a dummy job, to just wait for all tests to pass. This way
# we can specify single required status check instead of needing to
# specify all projects.
test_aggregate:
needs: odoo
runs-on: [self-hosted, pool]
steps:
- name: Pass
run: echo "Tests Passed" So if |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Went with extra job that explicitly forces failure. Though that job must be always run (both of those jobs are set as required via status checks): # This is a dummy job, to just wait for all tests to pass. This way
# we can specify single required status check instead of needing to
# specify all projects (which is kind of dynamic).
test_aggregate_success:
runs-on: [self-hosted, pool]
needs: odoo
steps:
- name: Pass
run: echo "Tests Passed"
test_aggregate_fail:
runs-on: [self-hosted, pool]
needs: odoo
if: |
always() &&
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
steps:
- uses: actions/github-script@v7
with:
script: |
core.setFailed('Previous jobs failed or were cancelled. Forcing failure') |
Beta Was this translation helpful? Give feedback.
Went with extra job that explicitly forces failure. Though that job must be always run (both of those jobs are set as required via status checks):