Unable to get release title in github actions

Solution 1:

Instead of triggering on the tag, trigger on the release creation. That way the release information will be present.

on:
  release:
    types: [published]

The tag will be under github.event.release.tag_name, the release under github.event.release.name.

Tags can be created independently of releases, that's why.

See:

  • https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
  • https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release