Support workflow_run events
Behaviour
Expected behaviour
A mention of the default behaviour of type=ref,event=branch is missing and it can lead users to unexpected results.
Actual behaviour
Updating the documentation with the default behaviour for events that are not listed or with an improvement of when a type=ref,event=branch will be used.
Configuration
- Repository URL (if public): N/A
- Build URL (if public): N/A
# paste your YAML workflow file here and remove sensitive data
N/A
Logs
Download the log file of your build and attach it to this issue.
There is no type=branch, did you mean type=ref,event=branch?
Yes @crazy-max, you are right. I'm updating the issue description.
My current expectation from the documentation is that type=ref,event=branch will only be enabled for workflows triggered by events related to the branch, such as push, workflow_dispatch, release, and workflow_run.
But for workflow_run I did expect to use the triggering workflow branch instead of github.ref.
What do you thing @crazy-max ?
The action does not support the workflow_run event. I will look at it.
But for
workflow_runI did expect to use the triggering workflow branch instead ofgithub.ref.
That's how that trigger always worked?
Note: This event will only trigger a workflow run if the workflow file is on the default branch.
So you should expect to only configure these from that default branch? How are you trying to leverage workflow_run with this action? Pull requests?
Unrelated to this action, I have used workflow_run for PR preview builds of docs where you need to volley an untrusted build over to a trusted context (where you don't want to run third-party code in):
- Prepare preview workflow (untrusted context, runs in PR branch)
-
Deploy preview workflow (trusted context via
workflow_run, runs from default branch)
As you can see in the deploy workflow, there is limited context of the original workflow branch (PR), some of the context needed is volleyed over via export + import of ENV, while other context from workflow_run can be used:
-
github.event.workflow_run.event == 'pull_request' -
github.event.workflow_run.head_sha -
github.event.workflow_run.id -
github.event.workflow_run.conclusion == 'success'