jayqi / failed-build-issue-action

An action that makes it easy to notify of a failed GitHub Actions workflow via an issue.
MIT License
3 stars 0 forks source link

Improve documentation on configuring when the action triggers #103

Closed phun-ky closed 6 months ago

phun-ky commented 7 months ago

Maybe i'm doing something wrong here, but the job is always skipped on failure:

https://github.com/entur/products-models/actions/runs/7841886029

jayqi commented 7 months ago

Hi @phun-ky,

If I'm understanding correctly, the run you linked is for a pull request.

The condition you have in your workflow configuration here is:

if: failure() && github.event.pull_request == null

The second part of that expression returns false if the triggering event is a pull request. If you want a notification even for a pull request event, you should change that conditional expression appropriately.

I have it that way in the example for this Action because my typical use case is that I want the notification on test failures when running on the main branch that are triggered by pushes and schedule, but not on test failures on pull requests.

phun-ky commented 6 months ago

hm, ok. what should that condition look like then? is it sufficient to just remove the second part of the conditional?

jayqi commented 6 months ago

Yes, if you remove the second part of the conditional, then with only failure() that step will trigger if any previous step or job in the workflow failed, no matter the type.

It looks like there's some room for improved documentation about this. I'm going to rename this issue to reflect that.

jayqi commented 6 months ago

Updated documentation in the readme with #107