0

I have github actions workflow which should be triggered on release creation

name: "Attach package to release assets"

# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
on:
  release:
    types: [published]
  workflow_dispatch:

and another workflow which is responsible for release creation and should trigger this event (and workflow)

      - name: Create release
        uses: thomaseizinger/create-release@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
          tag_name: ${{ env.RELEASE_VERSION }}
          name: ${{ env.RELEASE_VERSION }}
          body: ${{ steps.changelog_reader.outputs.changes }}
          draft: false
          prerelease: false

There is a release created on Github, so this action works properly. My question is how to debug events and see why first workflow is not invoked. I've tried already published and released without any effect.

Most Wanted
  • 6,254
  • 5
  • 53
  • 70
  • 1
    Triggering a workflow from another workflow event requires using a `PAT` instead of the `GITHUB_TOKEN`. Did you try using a PAT instead of `GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}`? – GuiFalourd Nov 17 '22 at 17:25
  • 1
    I think the GitHub `release` event may actually be broken in workflows. I've been trying to do the same thing without the programmatic trigger (just `on: [release]`) and it never fires but I can confirm the event is indeed happening. Seems like a platform bug. – probablyup Jul 06 '23 at 21:05

1 Answers1

1

As per official docs

For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow WILL NOT RUN even when the repository contains a workflow configured to run when push events occur.

See this link to create a custom token

Most Wanted
  • 6,254
  • 5
  • 53
  • 70