Cancelled Github actions fails PR checks #26127
-
Hi, I have setup Github actions for our company private repo to automatically deploy static site when new commits are pushed to master. To do this I use Filters for GitHub Actions. But when I create PR with new content filter action end with neutral status and the rest of actions (build and deploy) are cancelled which cause check to fail. And thus PR cannot be merged unless I disable the checks as mandatory in repo settings. Is this supposed behaivior? Or is there some way how to avoid this? I couldn’t find any relevant information about this. Below is my my workflow file:
Thanks for advice. |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments
-
Can you share more details about how you’ve configured protected branches for the repository (maybe a screenshot of the settings)? If it’s sensitive, we can move this to [email protected]. |
Beta Was this translation helpful? Give feedback.
-
I have currently checks disabled but this is the checks status I get: Since the action is only build and deploy on master branch (no check for pushing to branch like test etc.) |
Beta Was this translation helpful? Give feedback.
-
Is there any update on how you resolved this? I have the same problem. I created multiple workflows (one for every branch etc, one only for master and one only for develop). But when one of the workflows cancels (like when I push to develop, the workflow for master cancels), I get this red cross. Is there any possibility to ignore that and show a green check? |
Beta Was this translation helpful? Give feedback.
-
Does it change if you push the Build -step one up? My thought was just that then the workflow would have at least one step that is green before filter cancels. |
Beta Was this translation helpful? Give feedback.
-
This results in an overall failed check for me, too. |
Beta Was this translation helpful? Give feedback.
-
This issue in the actions repo deals about that. too. |
Beta Was this translation helpful? Give feedback.
-
Me too - details here: TypeStrong/ts-loader#893 |
Beta Was this translation helpful? Give feedback.
-
Didn’t find a way how to fix this. So for now I have to live with it like this. We have not set checks as mandatory in the repo so we can merge even with faild checks, but it is still annoying. |
Beta Was this translation helpful? Give feedback.
-
I did try different order of the actions in the flow but with no result. It always shows checks as failed. |
Beta Was this translation helpful? Give feedback.
-
Thanks for providing that additional information, so this behavior is expected but can see how it’s not ideal. We’re working on seeing how we can improve the situation. |
Beta Was this translation helpful? Give feedback.
-
That’s currently the best workaround. |
Beta Was this translation helpful? Give feedback.
-
I played around a lot and found out this works a lot more like I expected if you place the filter as a “need” for the resolving action. I modified the example workflow:
Now the PR checks are green and every action gets the status neutral. @mcolyerI this like it should be done? Maybe some notes in doc would help. |
Beta Was this translation helpful? Give feedback.
-
I think I found the right spot. The filter hast to be a requirement for the resolving action. Check my answer in this thread https://github.community/t5/GitHub-API-Development-and/Cancelled-Github-actions-fails-PR-checks/m-p/17464/highlight/true#M639 |
Beta Was this translation helpful? Give feedback.
-
I have tested your solution and it works so I accept it as a solution. Though donwside is that some steps are executed which may in the future expend limits for actions if there are one. Could be problematic for quite complicated workflow. Let’s hope GitHub folks will eventually fix this. |
Beta Was this translation helpful? Give feedback.
-
I think this works well - after reading more about this issue I think I originally misunderstood. We’re still looking to improve this area, so we’re taking your feedback to heart. |
Beta Was this translation helpful? Give feedback.
-
No I have almost the same problem again? Does anyone know how to handle this? |
Beta Was this translation helpful? Give feedback.
-
Doesn’t this then only run the build on the master branch? I am having the issue as I have the workflow of:
In code:
The problem with this is when Master failes - the PR fails. If we make Master and Test the needs of Deploy, if Master fails, Test doesn’t run., which we need it to to make sure the branch is good to merge… |
Beta Was this translation helpful? Give feedback.
I played around a lot and found out this works a lot more like I expected if you place the filter as a “need” for the resolving action.
I modified the example workflow:
Now the PR checks are green and every action gets the status neutral.
@mcolyerI this like it should be done? Maybe some notes in doc would help.