Event 'workflow_run' is only triggered once

Hi :wave:t2:.

I’ve been playing around with the workflow_run event, and came across somewhat of an issue/unexpected behaviour.

Given a workflow like this:

name: "workflow run webhook"

on:
  workflow_run:
    workflows: ["do something"]
    types: 
      - requested
      - completed

jobs:
  job:
    name: Handle workflow_run webhook
    runs-on: ubuntu-latest
    steps:
      - run: echo "${{ toJson(github.event) }}"

Expected:
The above workflow, will only run when another workflow (named “do something”), will be “requested” or “completed”.

Assuming a workflow run named “do something” has being requested, there will be two additional workflow runs triggered, one for the “requested” phase, and another one for the “completed” phase.

Unexpected:
When re-running the completed workflow (the one named “do something”) I would expect another two workflow runs to be triggered, one for the “requested” phase, and another for the “completed” phase, and yet, only one workflow triggered, and its the one for the “completed” phase.

So, to summarise, re-running a workflow, I would expect two additional workflow runs, and not just one.

P.S
The above is also relevant when registering for a “workflow_run” webhook.
I’ve also setup repo to demo the above scenario:

@eladchen ,

Thanks for your feedback.

I can reproduce the same behavior as you reported.
Looks like, ‘re-run’ is not considered as an ‘requested’. Only triggering a workflow run at the first time can be considered as ‘requested’.

If you really need the feature that workflow_run event can support the activity type ‘re-run’, I recommend that you can directly report a feature request here.
That will allow you to directly interact with the appropriate engineering team, and make it more convenient for the engineering team to collect and categorize your suggestions.

Thank you, I’ll do that.

It just stroke me that this is not a feature request, but more of a bug (“workflow._run.completed” does trigger when “re-run”)

How can I report this as a bug…?