GitHub Actions: A Neutral Status In One Action Cancels All Parallel Actions

This behavior seems wrong to me. What we want to do is run code lint when needed using parallel actions. If no files were changed that are appliable to a particular linter then it returns neutral status. We expect the remaining linters to continue as normal. However, they get cancelled automatically. 

Here’s our main.workflow file:

workflow "Housekeeping" {
  on = "push"
  resolves = ["Branch Cleanup"]
}

action "Branch Cleanup" {
  uses = "jessfraz/branch-cleanup-action@master"
  secrets = ["GITHUB_TOKEN"]
}

workflow "Slash Commands" {
  on = "issue_comment"
  resolves = ["/rebase"]
}

action "/rebase" {
  uses = "docker://cirrusactions/rebase:latest"
  secrets = ["GITHUB_TOKEN"]
}

workflow "Code Lint (Syntax)" {
  on = "push"
  resolves = [
    "Lint PHP 5.6",
    "Lint PHP 7.3.0",
    "Lint JavaScript",
    "Check Lint Results",
  ]
}

action "Get Changed Files" {
  uses = "lots0logs/gh-action-get-changed-files@master"
  secrets = ["GITHUB_TOKEN"]
}

action "Lint PHP 5.2" {
  uses = "docker://elegantthemes/gh-action-lint-php:5.2.17"
  needs = ["Get Changed Files"]
}

action "Lint PHP 5.6" {
  uses = "docker://elegantthemes/gh-action-lint-php:5.6.39"
  needs = ["Get Changed Files"]
}

action "Lint PHP 7.3.0" {
  uses = "docker://elegantthemes/gh-action-lint-php:7.3.0"
  needs = ["Get Changed Files"]
}

action "Lint JavaScript" {
  uses = "docker://elegantthemes/gh-action-lint-js:latest"
  needs = ["Get Changed Files"]
}

action "Check Lint Results" {
  uses = "lots0logs/gh-action-conditional-failure@1.0.0"
  needs = ["Lint PHP 5.2"]
  args = "--file-exists **/lint-failed/*"
  env = {
    success_msg = "Success! No syntax errors found."
    fail_msg = "Syntax errors found!"
  }
}
 

You can see the failure here: https://github.com/elegantthemes/submodule-builder/actions/workflow-runs/MDEwOkNoZWNrU3VpdGU2NjU0NDcxNQ==

4 Likes

I just discovered the same issue. This seems to have changed recently. Some older workflows did work like expected.

Now:

The same workflow a month ago. I am happy to help debugging.

I also just discovered this behavior and found out that it’s documented in the official docs (emphasis mine):

> When an action returns [the neutral exit status], GitHub terminates all concurrently running actions and prevents any future actions from starting.

The failure exit status shares the same behavior:

>  When an action fails, all concurrent actions are cancelled and future actions are skipped.

1 Like

I don´t know if it´s just me but this makes no real sense. The previous behavior was way more flexible for me.

@mcolyerDo you have any information about that?

3 Likes

Yeah, I’ve got the same observation. It’s not documented explicitly anywhere, so I’m not sure whether it’s expected or not. But +1 for making “filter” actions cancel only its branch, not parallel subflows…

3 Likes

Run into the same issue right now and in my opinion it does not make sense to cancel parallel tasks on a neutral exit…

@lee-dohm ^

As pointed out above, it is documented and intentional behavior. I’ve passed along the feedback to the developers but can’t make any promises on when or even if this behavior will be changed. For now, if you need parallel subflows to continue when a neutral status is returned, you may want to consider breaking them out into separate workflows.