Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Send multiple events at once #331

Open
Badisi opened this issue Jun 27, 2024 · 6 comments
Open

[FEATURE REQUEST] Send multiple events at once #331

Badisi opened this issue Jun 27, 2024 · 6 comments

Comments

@Badisi
Copy link

Badisi commented Jun 27, 2024

Thanks for this GH action !

I was wondering if it would be possible to send multiple events at once ?

I'm currently reusing too many workflows and hitting the error "too many workflows are referenced, total: 22, limit: 20".
See the documentation.
So it would be great to only use your job once and send all my events, instead of having to use a job per event.

@gnpaone
Copy link

gnpaone commented Jan 23, 2025

Yeah, I need this too. I can work on this issue if it's fine

@peter-evans
Copy link
Owner

Please could you explain your problem in more detail, preferably with examples. My current recommendation is to use a matrix, as described in the readme. Could you explain why that doesn't work for your use case(s).

@gnpaone
Copy link

gnpaone commented Jan 23, 2025

For example if we use the matrix, the same workflow runs twice (duplicate run for other steps) instead dispatch I want to dispatch to multiple repos or multiple events in single step

Example:

- name: Repo dispatch
  uses: peter-evans/repository-dispatch@v3
  with:
    event-type: ${{ matrix.events }}

Image

PS: well to avoid this I can run repo dispatch in separate jobs as a workaround but still for cases in same job

@Badisi
Copy link
Author

Badisi commented Jan 23, 2025

My personal use case is to dispatch multiple events in a row, not to dispatch an event to multiple repos.

The goal is to use your workflow once instead of N times, and do not break the total limit.

Example

Do this:

jobs:
    ci_tests:
        runs-on: 'ubuntu-latest'
        steps:
            - name: Test component A, B, C
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-types: [test_compA, test_compB, test_compC]

instead of this:

jobs:
    ci_tests:
        runs-on: 'ubuntu-latest'
        steps:
            - name: Test component A
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compA

            - name: Test component B
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compB

            - name: Test component C
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compC

@gnpaone
Copy link

gnpaone commented Jan 24, 2025

@Badisi Exactly the same use case for me too. By using matrix it's same as

jobs:
    ci_tests:
        runs-on: 'ubuntu-latest'
        steps:
            - name: Test component A
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compA

            - name: Test component B
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compB

            - name: Test component C
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-type: test_compC

@gnpaone
Copy link

gnpaone commented Jan 25, 2025

Or it can be

jobs:
    ci_tests:
        runs-on: 'ubuntu-latest'
        steps:
            - name: Test component A, B, C
              uses: peter-evans/repository-dispatch@v3
              with:
                  event-types: test_compA, test_compB, test_compC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants