[GH-ISSUE #227] Support targeting specific workflows #156

Closed
opened 2026-03-01 21:40:42 +03:00 by kerem · 3 comments
Owner

Originally created by @rbellamy on GitHub (May 8, 2020).
Original GitHub issue: https://github.com/nektos/act/issues/227

With multiple workflows it is possible to have workflows and jobs with non-unique IDs.

one.yml

name: basic
on: push

env:
  TEST: monkeys

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - run: echo ${{ env.TEST }} | grep value

two.yml

name: basic
on: pull_request

env:
  TEST: shine

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - run: echo ${{ env.TEST }} | grep value

Right now the ability to target a job when working with multiple workflows requires that the job have a unique ID.

I think the best option would be to allow the -W flag to accept an array of workflow files (new feature) or a directory (current functionality).

I'm a novice at Go or I would create a PR. If it's relatively simple, and someone could give me some pointers, I'd be glad to give it a shot. I've looked at the code, and am unsure where to start.

Originally created by @rbellamy on GitHub (May 8, 2020). Original GitHub issue: https://github.com/nektos/act/issues/227 With multiple workflows it is possible to have workflows and jobs with non-unique IDs. *one.yml* ```yaml name: basic on: push env: TEST: monkeys jobs: check: runs-on: ubuntu-latest steps: - run: echo ${{ env.TEST }} | grep value ``` *two.yml* ```yaml name: basic on: pull_request env: TEST: shine jobs: check: runs-on: ubuntu-latest steps: - run: echo ${{ env.TEST }} | grep value ``` Right now the ability to target a job when working with multiple workflows requires that the job have a unique ID. I think the best option would be to allow the `-W` flag to accept an array of workflow files (new feature) or a directory (current functionality). I'm a novice at Go or I would create a PR. If it's relatively simple, and someone could give me some pointers, I'd be glad to give it a shot. I've looked at the code, and am unsure where to start.
Author
Owner

@arbourd commented on GitHub (May 23, 2020):

Agreed. I use Actions in a monorepo and each microservice gets 1-2 workflows. I just delete the other ones I'm not testing locally right now, which isn't really inconvenient.

Repurposing the -W flag would be really easy but I'm not sure if the maintainers would like a dual-purpose flag.

<!-- gh-comment-id:633124183 --> @arbourd commented on GitHub (May 23, 2020): Agreed. I use Actions in a monorepo and each microservice gets 1-2 workflows. I just delete the other ones I'm not testing locally right now, which isn't really inconvenient. Repurposing the -W flag would be really easy but I'm not sure if the maintainers would like a dual-purpose flag.
Author
Owner

@cplee commented on GitHub (May 26, 2020):

I like the option of -W support a list of files or directory. Open to PRs on this if someone wants to do it!

<!-- gh-comment-id:634114446 --> @cplee commented on GitHub (May 26, 2020): I like the option of `-W` support a list of files or directory. Open to PRs on this if someone wants to do it!
Author
Owner

@arbourd commented on GitHub (May 27, 2020):

Thanks for the quick turn around @cplee.

<!-- gh-comment-id:634711137 --> @arbourd commented on GitHub (May 27, 2020): Thanks for the quick turn around @cplee.
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#156
No description provided.