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

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.

17 Replies
GitHub Staff
Message 2 of 18

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 18

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 18

Re: Cancelled Github actions fails PR checks

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

GitHub Staff
Message 5 of 18

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.

Highlighted
Solution
Copilot Lvl 3
Message 6 of 18

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 18

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 18

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.

Copilot Lvl 3
Message 9 of 18

Re: Cancelled Github actions fails PR checks

No I have almost the same problem again? Does anyone know how to handle this?

 

https://github.community/t5/GitHub-API-Development-and/GitHub-Actions-A-Neutral-Status-In-One-Action...

Copilot Lvl 2
Message 10 of 18

Re: Cancelled Github actions fails PR checks

Doesn't this then only run the build on the master branch?

 

I am having the issue as I have the workflow of:

- Build

- Test

- Is master

- Deploy

 

In code:

 

workflow "BTMD" {
  on = "push"
  resolves = ["Deploy"]
}

action "Build" {
  # blah
}

action "Test" {
  # blah
  needs = ["Build"]
}

action "Master" {
  # blah
  needs = ["Test"]
}

action "Deploy" {
  # blah
  needs = ["Master"]
}

 

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...