convictional / trigger-workflow-and-wait

Trigger a workflow in another (or same) repository and wait for the job to finish.
MIT License
311 stars 151 forks source link

Incorrect workflow_id when 2 matrix jobs triggers `trigger-workflow-and-wait` at the same time #61

Open hpsony94 opened 1 year ago

hpsony94 commented 1 year ago

Hi guys,

I am facing this issue in this context: For instance, I have 2 repositories such as

- github.com/example/test (`test` repo)

name: Dispatch CI on: workflow_dispatch: inputs: testsuite: description: 'a Set of test cases' required: true default: 'test01' type: choice options:

jobs: dispatch-ci: name: run ${{ inputs.testsuite }} test runs-on: ci-general if: github.ref == 'refs/heads/master' steps:

The dispatch-ci job in Dispatch CI workflow has been triggered via the change of master branch in the main repo.

But the thing is that it triggered it successfully but the result of checking the dispatch-ci job is incorrect.

After reading the code, I realized that there are 2 points

I'd like to raise this issue for further discussion to find alternative solutions which we can contribute wherever in this actions plugin or Github actions API ....

matt-vendia commented 1 year ago

Having the same problem when kicking off 2 remote actions at the same time in the same target repo. Both source actions are completing when one of the target actions completes. Going to try delaying invocation on one action to see if that works as a stop-gap.

a-chatterjee commented 1 year ago

Facing the same issue.

chicocvenancio commented 1 year ago

We're also facing this issue.

mattthaber commented 1 year ago

this repo seems unmaintained at this point. might just fork and fix this issue

oleksandr-ivanov-ah commented 8 months ago

I'm also facing the same issue

xnap commented 7 months ago

same

henryjw commented 7 months ago

If anyone else is facing this issue, I've implemented a workaround by using a run name that's unique enough per workflow. It's not a perfect solution, but it works for my use case.

The change is on tag 1.7.0 on my fork. https://github.com/henryjw/trigger-workflow-and-wait#known-issues

Example https://github.com/henryjw/workflow-trigger-test/commit/88082aa0e9cb4a45c79a14bd2353c83c7ee6ea1e