[GH-ISSUE #64] support multi-workflow setups #38

Closed
opened 2026-03-01 21:39:18 +03:00 by kerem · 2 comments
Owner

Originally created by @maxheld83 on GitHub (May 20, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/64

it appears that currently, act cannot deal with multi-workflow setups (i.e. >1 workflow statements with on = "push"), though these are supported by GitHub Actions.

Here's an (unfortunately not minimal) example:

workflow "Build and Check" {
  on = "push"
  resolves = [
    "Check Package",
    "Build Website"
  ]
}

workflow "Deploy" {
  on = "push"
  resolves = [
    "Upload Cache",
    "Code Coverage",
    "Deploy Website"
  ]
}

action "GCP Authenticate" {
  uses = "actions/gcloud/auth@04d0abbbe1c98d2d4bc19dc76bcb7754492292b0"
  secrets = [
    "GCLOUD_AUTH"
  ]
}

action "Download Cache" {
  uses = "actions/gcloud/cli@d124d4b82701480dc29e68bb73a87cfb2ce0b469"
  runs = "gsutil -m cp -r gs://ghactions-cache/lib.tar.gz /github/home/"
  needs = [
    "GCP Authenticate"
  ]
}

action "Decompress Cache" {
  uses = "actions/bin/sh@5968b3a61ecdca99746eddfdc3b3aab7dc39ea31"
  runs = "tar -zxf /github/home/lib.tar.gz --directory /github/home"
  needs = [
    "Download Cache"
  ]
}

action "Install Dependencies" {
  uses = "./actions/install-deps"
  needs = [
    "Decompress Cache"
  ]
}

action "Compress Cache" {
  uses = "actions/bin/sh@5968b3a61ecdca99746eddfdc3b3aab7dc39ea31"
  runs = "tar -zcf lib.tar.gz --directory /github/home lib"
  needs = [
    "Install Dependencies"
  ]
}

action "Upload Cache" {
  uses = "actions/gcloud/cli@d124d4b82701480dc29e68bb73a87cfb2ce0b469"
  runs = "gsutil -m cp lib.tar.gz gs://ghactions-cache/"
  needs = [
    "Compress Cache",
    "Filter Not Act"
  ]
}

action "Build Package" {
  uses = "./actions/build"
  needs = [
    "Install Dependencies"
  ]
}

action "Filter Not Act" {
  uses = "actions/bin/filter@3c0b4f0e63ea54ea5df2914b4fabf383368cd0da"
  args = "not actor nektos/act"
}

action "Code Coverage" {
  uses = "./actions/covr"
  needs = [
    "Check Package",
    "Filter Not Act"
  ]
  secrets = [
    "CODECOV_TOKEN"
  ]
}

action "Check Package" {
  uses = "./actions/check"
  needs = [
    "Build Package"
  ]
}

action "Install Package" {
  uses = "./actions/install"
  needs = [
    "Build Package"
  ]
}

action "Build Website" {
  uses = "./actions/pkgdown"
  needs = [
    "Install Package"
  ]
}

action "Master Branch" {
  uses = "actions/bin/filter@c6471707d308175c57dfe91963406ef205837dbd"
  needs = [
    "Check Package", 
    "Build Website"
  ]
  args = "branch master"
}

action "Deploy Website" {
  uses = "maxheld83/ghpages@v0.1.1"
  env = {
    BUILD_DIR = "docs"
  }
  secrets = ["GH_PAT"]
  needs = [
    "Master Branch",
    "Filter Not Act"
  ]
}

On act, this fails both workflows pretty soon with error: exit with NEUTRAL: 78, even though only one of the workflows even includes any kind of filter action.

This presumably imperfect parsing of the main.workflow is also (?) reflected in act -l output:

                    ╔═════════════╗
                    ║ EVENT: push ║
                    ╚═════════════╝
                           ⬇
        ╭──────────────────╮ ╭────────────────╮
        │ GCP Authenticate │ │ Filter Not Act │
        ╰──────────────────╯ ╰────────────────╯
                           ⬇
                   ╭────────────────╮
                   │ Download Cache │
                   ╰────────────────╯
                           ⬇
                  ╭──────────────────╮
                  │ Decompress Cache │
                  ╰──────────────────╯
                           ⬇
                ╭──────────────────────╮
                │ Install Dependencies │
                ╰──────────────────────╯
                           ⬇
          ╭───────────────╮ ╭────────────────╮
          │ Build Package │ │ Compress Cache │
          ╰───────────────╯ ╰────────────────╯
                           ⬇
 ╭─────────────────╮ ╭──────────────╮ ╭───────────────╮
 │ Install Package │ │ Upload Cache │ │ Check Package │
 ╰─────────────────╯ ╰──────────────╯ ╰───────────────╯
                           ⬇
          ╭───────────────╮ ╭───────────────╮
          │ Build Website │ │ Code Coverage │
          ╰───────────────╯ ╰───────────────╯
                           ⬇
                   ╭───────────────╮
                   │ Master Branch │
                   ╰───────────────╯
                           ⬇
                   ╭────────────────╮
                   │ Deploy Website │
                   ╰────────────────╯
                    ╔═════════════╗
                    ║ EVENT: push ║
                    ╚═════════════╝
                           ⬇
        ╭────────────────╮ ╭──────────────────╮
        │ Filter Not Act │ │ GCP Authenticate │
        ╰────────────────╯ ╰──────────────────╯
                           ⬇
                   ╭────────────────╮
                   │ Download Cache │
                   ╰────────────────╯
                           ⬇
                  ╭──────────────────╮
                  │ Decompress Cache │
                  ╰──────────────────╯
                           ⬇
                ╭──────────────────────╮
                │ Install Dependencies │
                ╰──────────────────────╯
                           ⬇
          ╭────────────────╮ ╭───────────────╮
          │ Compress Cache │ │ Build Package │
          ╰────────────────╯ ╰───────────────╯
                           ⬇
 ╭─────────────────╮ ╭───────────────╮ ╭──────────────╮
 │ Install Package │ │ Check Package │ │ Upload Cache │
 ╰─────────────────╯ ╰───────────────╯ ╰──────────────╯
                           ⬇
          ╭───────────────╮ ╭───────────────╮
          │ Build Website │ │ Code Coverage │
          ╰───────────────╯ ╰───────────────╯
                           ⬇
                   ╭───────────────╮
                   │ Master Branch │
                   ╰───────────────╯
                           ⬇
                   ╭────────────────╮
                   │ Deploy Website │
                   ╰────────────────╯

Apparently, act here mushes the two workflows together.

Originally created by @maxheld83 on GitHub (May 20, 2019). Original GitHub issue: https://github.com/nektos/act/issues/64 it appears that currently, `act` cannot deal with multi-workflow setups (i.e. >1 `workflow` statements with `on = "push"`), though these *are* supported by GitHub Actions. Here's an (unfortunately not minimal) example: ``` workflow "Build and Check" { on = "push" resolves = [ "Check Package", "Build Website" ] } workflow "Deploy" { on = "push" resolves = [ "Upload Cache", "Code Coverage", "Deploy Website" ] } action "GCP Authenticate" { uses = "actions/gcloud/auth@04d0abbbe1c98d2d4bc19dc76bcb7754492292b0" secrets = [ "GCLOUD_AUTH" ] } action "Download Cache" { uses = "actions/gcloud/cli@d124d4b82701480dc29e68bb73a87cfb2ce0b469" runs = "gsutil -m cp -r gs://ghactions-cache/lib.tar.gz /github/home/" needs = [ "GCP Authenticate" ] } action "Decompress Cache" { uses = "actions/bin/sh@5968b3a61ecdca99746eddfdc3b3aab7dc39ea31" runs = "tar -zxf /github/home/lib.tar.gz --directory /github/home" needs = [ "Download Cache" ] } action "Install Dependencies" { uses = "./actions/install-deps" needs = [ "Decompress Cache" ] } action "Compress Cache" { uses = "actions/bin/sh@5968b3a61ecdca99746eddfdc3b3aab7dc39ea31" runs = "tar -zcf lib.tar.gz --directory /github/home lib" needs = [ "Install Dependencies" ] } action "Upload Cache" { uses = "actions/gcloud/cli@d124d4b82701480dc29e68bb73a87cfb2ce0b469" runs = "gsutil -m cp lib.tar.gz gs://ghactions-cache/" needs = [ "Compress Cache", "Filter Not Act" ] } action "Build Package" { uses = "./actions/build" needs = [ "Install Dependencies" ] } action "Filter Not Act" { uses = "actions/bin/filter@3c0b4f0e63ea54ea5df2914b4fabf383368cd0da" args = "not actor nektos/act" } action "Code Coverage" { uses = "./actions/covr" needs = [ "Check Package", "Filter Not Act" ] secrets = [ "CODECOV_TOKEN" ] } action "Check Package" { uses = "./actions/check" needs = [ "Build Package" ] } action "Install Package" { uses = "./actions/install" needs = [ "Build Package" ] } action "Build Website" { uses = "./actions/pkgdown" needs = [ "Install Package" ] } action "Master Branch" { uses = "actions/bin/filter@c6471707d308175c57dfe91963406ef205837dbd" needs = [ "Check Package", "Build Website" ] args = "branch master" } action "Deploy Website" { uses = "maxheld83/ghpages@v0.1.1" env = { BUILD_DIR = "docs" } secrets = ["GH_PAT"] needs = [ "Master Branch", "Filter Not Act" ] } ``` On `act`, this fails *both workflows* pretty soon with `error: exit with `NEUTRAL`: 78`, even though only *one* of the workflows even includes any kind of `filter` action. This presumably imperfect parsing of the `main.workflow` is also (?) reflected in `act -l` output: ``` ╔═════════════╗ ║ EVENT: push ║ ╚═════════════╝ ⬇ ╭──────────────────╮ ╭────────────────╮ │ GCP Authenticate │ │ Filter Not Act │ ╰──────────────────╯ ╰────────────────╯ ⬇ ╭────────────────╮ │ Download Cache │ ╰────────────────╯ ⬇ ╭──────────────────╮ │ Decompress Cache │ ╰──────────────────╯ ⬇ ╭──────────────────────╮ │ Install Dependencies │ ╰──────────────────────╯ ⬇ ╭───────────────╮ ╭────────────────╮ │ Build Package │ │ Compress Cache │ ╰───────────────╯ ╰────────────────╯ ⬇ ╭─────────────────╮ ╭──────────────╮ ╭───────────────╮ │ Install Package │ │ Upload Cache │ │ Check Package │ ╰─────────────────╯ ╰──────────────╯ ╰───────────────╯ ⬇ ╭───────────────╮ ╭───────────────╮ │ Build Website │ │ Code Coverage │ ╰───────────────╯ ╰───────────────╯ ⬇ ╭───────────────╮ │ Master Branch │ ╰───────────────╯ ⬇ ╭────────────────╮ │ Deploy Website │ ╰────────────────╯ ╔═════════════╗ ║ EVENT: push ║ ╚═════════════╝ ⬇ ╭────────────────╮ ╭──────────────────╮ │ Filter Not Act │ │ GCP Authenticate │ ╰────────────────╯ ╰──────────────────╯ ⬇ ╭────────────────╮ │ Download Cache │ ╰────────────────╯ ⬇ ╭──────────────────╮ │ Decompress Cache │ ╰──────────────────╯ ⬇ ╭──────────────────────╮ │ Install Dependencies │ ╰──────────────────────╯ ⬇ ╭────────────────╮ ╭───────────────╮ │ Compress Cache │ │ Build Package │ ╰────────────────╯ ╰───────────────╯ ⬇ ╭─────────────────╮ ╭───────────────╮ ╭──────────────╮ │ Install Package │ │ Check Package │ │ Upload Cache │ ╰─────────────────╯ ╰───────────────╯ ╰──────────────╯ ⬇ ╭───────────────╮ ╭───────────────╮ │ Build Website │ │ Code Coverage │ ╰───────────────╯ ╰───────────────╯ ⬇ ╭───────────────╮ │ Master Branch │ ╰───────────────╯ ⬇ ╭────────────────╮ │ Deploy Website │ ╰────────────────╯ ``` Apparently, `act` here mushes the two workflows together.
kerem 2026-03-01 21:39:18 +03:00
Author
Owner

@itsjoekent commented on GitHub (Jun 1, 2019):

Having this problem as well :(

<!-- gh-comment-id:497964382 --> @itsjoekent commented on GitHub (Jun 1, 2019): Having this problem as well :(
Author
Owner

@cplee commented on GitHub (Feb 18, 2020):

closing as this is pre GA of github actions

<!-- gh-comment-id:587296758 --> @cplee commented on GitHub (Feb 18, 2020): closing as this is pre GA of github actions
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#38
No description provided.