Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 16

Cancelled Github actions fails PR checks

Solved! Go to Solution.

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:

 

workflow "Deploy to Firebase" {
  on = "push"
  resolves = ["Deploy"]
}

action "On master branch" {
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "Build" {
  needs = "On master branch"
  uses = "./.github/gatsby-build"
}

action "Deploy" {
  needs = "Build"
  uses = "webscopeio/firebase-deploy-github-action@master"
  secrets = ["FIREBASE_AUTH_TOKEN"]
  args = "--only hosting"
}

Thanks for advice.

15 Replies
GitHub Staff
Message 2 of 16

Re: Cancelled Github actions fails PR checks

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 support@github.com.

Copilot Lvl 3
Message 3 of 16

Re: Cancelled Github actions fails PR checks

I have currently checks disabled but this is the checks status I get:Screenshot 2018-12-13 at 09.08.57.png

 

Since the action is only build and deploy on master branch (no check for pushing to branch like test etc.)

Copilot Lvl 3
Message 4 of 16

Re: Cancelled Github actions fails PR checks

This issue in the actions repo deals about that. too.

GitHub Staff
Message 5 of 16

Re: Cancelled Github actions fails PR checks

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.

Solution
Copilot Lvl 3
Message 6 of 16

Re: Cancelled Github actions fails PR checks

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:

workflow "Deploy to Firebase" {
  on = "push"
  resolves = ["Deploy"]
}

action "On master branch" {
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "Build" {
  uses = "./.github/gatsby-build"
}

action "Deploy" {
  needs = ["Build",  "On master branch"]
  uses = "webscopeio/firebase-deploy-github-action@master"
  secrets = ["FIREBASE_AUTH_TOKEN"]
  args = "--only hosting"
}

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.

Copilot Lvl 3
Message 7 of 16

Re: Cancelled Github actions fails PR checks

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. 

GitHub Staff
Message 8 of 16

Re: Cancelled Github actions fails PR checks

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.

Ground Controller Lvl 1
Message 9 of 16

Re: Cancelled Github actions fails PR checks

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?

Copilot Lvl 3
Message 10 of 16

Re: Cancelled Github actions fails PR checks

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.