GeezerVison is showing github.com — On: workflow_run: does not work for me · community · Discussion #25288
On: workflow_run: does not work for me
#25288
Aug 24, 2020
·
12 comments
·
6 replies
Discussion options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Hi all,
I have a workflow that is triggered on release
name: CreateRelease
on:
release:
types: [published]
and a workflow that should be triggered after the CreateRelease workflow runned
name: GitHub Linux Release
on:
workflow_run:
workflows: ["CreateRelease"]
branches: [master]
types:
- completed
- requested
second workflow is never triggered, why? thanks!
I want to create a release in a workflow triggered by a tag push,
after the release has been created, I want to trigger two workflow that build the linux and windows build.
how can I do it?
|
You must be logged in to vote
@sblantipodi,
Is the workflow “GitHub Linux Release” existing on the master or default branch?
To trigger a workflow runs on the workflow_run event, the workflow file should exist on the master or default branch.
Here is a recent reported similar topic as reference:
<a href="https://github.community/t/workflow-runs-not-starting-after-previous-workflow-completes/128345/8">Workflow runs not starting after previous workflow completes</a> <a class="badge-wrapper bullet" href="/c/code-to-cloud/github-actions/41"><span class="badge-category-parent-bg" style="background-color: #6a737d;"></span><span class="badge-category-bg" style="background-color: #2188ff;"></span><span style="" data-drop-c…
Replies:
12 comments
·
6 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
@sblantipodi,
Is the workflow “GitHub Linux Release” existing on the master or default branch?
To trigger a workflow runs on the workflow_run event, the workflow file should exist on the master or default branch.
Here is a recent reported similar topic as reference:
<a href="https://github.community/t/workflow-runs-not-starting-after-previous-workflow-completes/128345/8">Workflow runs not starting after previous workflow completes</a> <a class="badge-wrapper bullet" href="/c/code-to-cloud/github-actions/41"><span class="badge-category-parent-bg" style="background-color: #6a737d;"></span><span class="badge-category-bg" style="background-color: #2188ff;"></span><span style="" data-drop-close="true" class="badge-category clear-badge" title="Discussion and questions about GitHub Actions—automation for all of your development workflows, now with world-class CI/CD.">GitHub Actions</span></a>
@andrewconnell,
There are few points maybe can explain the problems:
The workflow runs on workflow_run event must exist on the master or default branch. And this workflow will only run on the master or default branch, regardless of whether it is triggered by a workflow run on other branches or not.
On the Actions page of a repository, under the “All workflows”, generally the following workflows are listed:
The workflow files exist on any branches, and the workflows have been triggered …
In addition, if you want the workflow “GitHub Linux Release” is triggered after the workflow “CreateRelease” completed, you should only use the type “completed”.
If the problem still exists, please share your repository with us (if possible), so that we can check more detailed configurations related to the workflows to analyze the root cause.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
thanks for the answer, at the end I solved using a multi job workflow. but I understood your suggestion, thanks for the help. love GitHub and its community.
|
You must be logged in to vote
1 reply
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
@sblantipodi : please let me know how did you solved this and what changes you have done w.r.t the example which you have given
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
I encountered the issue on my repo here.
So the workflows exist on the master but the default branch cant be the master because we depend on another functionality(wei/pull) to pull from the project that is forked.
Any suggestions as to why this would happen or how I could remedy it ?
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
The workflow dispatch UI on the website has a drop-down menu to select a branch. Maybe put some placeholder workflow on the default branch and the real workflow on the desired branch (here: master), with the exact name file name?
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Ok so I am managing everything on the default branch now as actions on master don’t work like they should.
Now the issue I am having is all the Windows actions get run but as soon as the last windows one is done(WindowsLibd3d12) the one that depends on that one(html5 library) doesn’t get called.
Could it be related to the fact that they use a different platform(one windows and the other ubuntu) or is it because libd3d12 is the last file and html5 library is the first file in the folder hierarchy ?
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
So after doing a Test it seems to be that workflow_run is capped at max 3 subsequent runs ? that is weird
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
It could be a deliberate limit to prevent endless loops of workflows being triggered, but if this is actually a restriction then it should be documented.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Have also just hit this undocumented arbitrary limit of 3 consecutive runs using on workflow_run.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
You must be logged in to vote
5 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
does this mean the workflow will only run on the default branch?
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
I finally figured it out for myself: it is not true the workflow only runs on de default branch. But it has to be on the default branch in order to execute the workflow_run trigger on any branch.
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
@FredFlitsPaal how were you able to do this? I have the workflow_run trigger on different branches, but the workflow only runs for the default branch.
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
I have the following on the default branch. Indenting is gone sorry about that.
on: workflow_run: workflows: ["Run unit tests"] types: - completed
Since this is present in the workflow file on the default branch, it works on other branches as well as long as the workflow filename is not changed.
|
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
I am also seeing this issue, was there a resolution to it?
My workflow files are all on the master (default) branch and I am not seeing my test workflow run after the initial build workflow completes.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Is it possible to use workflow_run: trigger from a workflow in different repository? I think this is more of a 'real use case' scenario.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Unfortunately almost 5 years after this post Github still has not changed the way workflow_run behaves. Workflow_run can be triggered from any branch, but the targeted workflow will always be executed on the default branch.
To fix this behaviour and actually do what I (and most of us) expect it to do, I added the followiong to the checkout action:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
This checks out the branch from which the workflow_run call is being made.
Yes I had to first add everything into the main branch, yes it is annoying and confusing, but it is what it is.
|
You must be logged in to vote
0 replies
Labels
Product Feedback
Share your thoughts and suggestions on GitHub features and improvements
|