You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 dataN/A
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.
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:
In my workflow, I'm usually use workflow_run for deployment or generate reports right after "main" workflow, the main workflow is typically a test or compiling assets either from push or pull_request event. Since previously I always work on single default branch, I had no issue whatsoever, but this time I attempt to work in 4 branches that has completely different commit histories. That said I want each branch has its own docker image.
I'm aware that workflow_run can only run on default branch. That's why some actions provides a way to use another branch and fallback to github.ref if empty.
I was expecting that once actions/checkout checkout another branch it will applied to steps below it. But apparently this issue told me otherwise, specifically the nature of workflow_run.
I was expecting that once actions/checkout checkout another branch it will applied to steps below it. But apparently this issue told me otherwise, specifically the nature of workflow_run.
actions/checkout affects path based context in other actions that might use that (eg: docker/build-push-action with it's context: . input).
See my previous comment for information about the workflow_run event trigger and other context that you're interested in, since the main github context used by this action is related to the default branch and commit (ref) of it's own workflow, not the triggering one that is carried in workflow_run context.
For clarity to others, you're requesting this action support new inputs for overriding context fields that the action presently uses internally from the main github context.
The github repo checkout is irrelevant as the repo doesn't contain all the same context info used, furthermore like I stated a git repo checkout could be completely unrelated to your own repo (if any checkout step is even done prior to this action).
It's been established that overriding the github.ref and github.event_name (or rather in this case opt-in to use the workflow run context in a non-breaking way, perhaps after a major version bump) can be useful. With the right overrides for example, you could better simulate a tag event to extract the value implicitly instead of assigning explicit value={{ inputs.version }} to each tag rule.
Activity
crazy-max commentedon Jan 16, 2023
There is no
type=branch, did you meantype=ref,event=branch?overbit commentedon Jan 17, 2023
Yes @crazy-max, you are right. I'm updating the issue description.
overbit commentedon Jan 17, 2023
My current expectation from the documentation is that
type=ref,event=branchwill only be enabled for workflows triggered by events related to the branch, such aspush,workflow_dispatch,release, andworkflow_run.But for
workflow_runI did expect to use the triggering workflow branch instead ofgithub.ref.What do you thing @crazy-max ?
crazy-max commentedon Apr 17, 2023
The action does not support the
workflow_runevent. I will look at it.[-]Missing documentation about type=branch on workflow_run events[/-][+]Support workflow_run events[/+]polarathene commentedon Oct 16, 2023
That's how that trigger always worked?
workflow_runevent docs:So you should expect to only configure these from that default branch? How are you trying to leverage
workflow_runwith this action? Pull requests?Unrelated to this action, I have used
workflow_runfor 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):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_runcan be used:github.event.workflow_run.event == 'pull_request'github.event.workflow_run.head_shagithub.event.workflow_run.idgithub.event.workflow_run.conclusion == 'success'feryardiant commentedon Mar 9, 2025
Any plan on this?
In my workflow, I'm usually use
workflow_runfor deployment or generate reports right after "main" workflow, the main workflow is typically a test or compiling assets either frompushorpull_requestevent. Since previously I always work on single default branch, I had no issue whatsoever, but this time I attempt to work in 4 branches that has completely different commit histories. That said I want each branch has its own docker image.I'm aware that
workflow_runcan only run on default branch. That's why some actions provides a way to use another branch and fallback togithub.refif empty.actions/checkouthasrefinput to checkout another branchdawidd6/action-download-artifacthasbranchinput to download artifact from previous workflow on specific branchI was expecting that once
actions/checkoutcheckout another branch it will applied to steps below it. But apparently this issue told me otherwise, specifically the nature ofworkflow_run.polarathene commentedon Jan 18, 2026
actions/checkoutaffects path based context in other actions that might use that (eg:docker/build-push-actionwith it'scontext: .input).See my previous comment for information about the
workflow_runevent trigger and other context that you're interested in, since the maingithubcontext used by this action is related to the default branch and commit (ref) of it's own workflow, not the triggering one that is carried inworkflow_runcontext.For clarity to others, you're requesting this action support new inputs for overriding context fields that the action presently uses internally from the main
githubcontext.github.refandgithub.event_name(or rather in this case opt-in to use the workflow run context in a non-breaking way, perhaps after a major version bump) can be useful. With the right overrides for example, you could better simulate a tag event to extract the value implicitly instead of assigning explicitvalue={{ inputs.version }}to each tag rule.