Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 3

Github Action trigger on release not working if releases was created by automation?

Solved! Go to Solution.

I've been working on some workflows that automatically build & release my application using Github Actions.

i have 2 workflows:

 

1 build workflow -> this workflow builds my solution and creates some artifacts (zip files). using the Hub cli i create a release and attach these zip files to the release.

source here: https://github.com/XpiritBV/beer-xchange/blob/master/.github/workflows/build.yml

 

1 release workflow -> this workflow should trigger on a release that is created, download the zip files from the release and deploy them to my environments. however the release trigger is not triggered when the release is created.

source here: https://github.com/XpiritBV/beer-xchange/blob/master/.github/workflows/release-prod.yml

 

i've tried different things to trigger the release workflow with just on: release to defining the types but results are the same. It just doesn't trigger the workflow.

on:
  release: 
    types: [created, published]

When i create a new release by hand instead of using the hub cli it does trigger my workflow. Any ideas how come?

 

edit: i checked running `hub release create` by hand and then the release workflow just starts. there is something that if it is triggered inside another workflow that it doesn't trigger it.

Geert van der Cruijsen (DevOps Consultant & Cloud Native Architect @ Xpirit Netherlands)
2 Replies
Highlighted
Solution
Copilot Lvl 3
Message 2 of 3

Re: Github Action trigger on release not working if releases was created by automation?

I found the solution with help from @ethomson on twitter. The thing I changed is instead of passing in the default GITHUB_TOKEN you have in your secrets during a workflow I'm using my personal PAT token.

Geert van der Cruijsen (DevOps Consultant & Cloud Native Architect @ Xpirit Netherlands)
Copilot Lvl 2
Message 3 of 3

Re: Github Action trigger on release not working if releases was created by automation?

Thank you for this, I feel like this should be a bug....