re-actors / alls-green

A check for whether the dependency jobs are all green.
https://github.com/marketplace/actions/alls-green
BSD 3-Clause "New" or "Revised" License
114 stars 12 forks source link

Cannot use this action in a chain #25

Closed LecrisUT closed 11 months ago

LecrisUT commented 11 months ago

Example:

  test:
    uses: ...
    if: "! inputs.skip-tests"

  test-status:
    needs: [ test ]
    runs-on: ubuntu-latest
    steps:
      - uses: re-actors/alls-green@release/v1
        with:
          allowed-skips: test
          jobs: ${{ toJSON(needs) }}
    if: always()

  build:
    needs: [ test-status ]
    uses: ...

The latter job is not run, probably because of the needs of the former

Upvote & Fund

Fund with Polar

webknjaz commented 11 months ago

That works in our own CI. Perhaps, yours is misconfigured somehow 🤷‍♂️.

Anyway, it's not something related to the action (as it only works with the inputs passed in), but is happening on the workflow definition level, which we wouldn't be able to control, even if we wanted to.

Closing as it's not a bug for us, but something on the calling side.

webknjaz commented 11 months ago

If you want to run a job despite test-status failing, you'll have to stick if: always() there too. Although I don't know what use case this would actually support.

LecrisUT commented 11 months ago

I should clarify the example given. The issue is when test job is skipped, test-status of course runs, but build is skipped as if the skip status propagated through. I'll make a mwe tomorrow.

Indeed this is a usage issue, but it is not intuitive how it should be configured, so some documentation would be helpful for such scenario.

LecrisUT commented 11 months ago

@webknjaz here is a mwe if you have any pointers about it: https://github.com/LecrisUT/all-greens-example