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

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.

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.

3 Likes

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

4 Likes

@github is this expected behavior?

@nkt as you see in my answer @ethomson (who works for Github) mentioned that this is how they designed it (see tweet link above in my answer)

Suboptimal from the users perspective :slightly_frowning_face: