List of Placeholders to use

I would like to add a Discord notification system with GitHub Actions, to notify others about new releases I publish on the repository.

I use rjstone/discord-webhook-notify for this.

The thing now is, that I want to display details from the release within the webhook message.

I know that there are placeholders for several things, but I’m unable to find any kind of cheatsheet to see what placeholders are available for what values.

Like I mentioned do I trigger this action on a Release, meaning I want to receive the title, version tag and description of said release, to use.

Here’s my current workflow I setup:

name: Publication task

on:
  release:
    types: [published]
    branches:
    - master

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Publish (Bintray) # Used to publish to bintray.
      env:
        bintrayUser: ${{ secrets.bintrayUsername }}
        bintrayApiKey: ${{ secrets.bintrayApiKey }}
        BUILD_NUMBER: 0 # Releases are always major.minor.revision_0
      run: ./gradlew bintrayUpload
  sendMessage: # This is the notification task I want to use.
    if: success()
    runs-on: ubuntu-latest
    steps:
    - name: Discord notification
      uses: rjstone/discord-webhook-notify@v1.0.2
      with:
        webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
        severity: info
        username: New release
        description: ' **Release Information**'
        details: ''

You could get release title, version tag and description from the github.event context. Use {{ github.event.release.name }} to get the title, use {{ github.event.release.body }} to get the release description. Please see my example:

release event.png

This is my release information:

This is the github.event context showing in debug logs:

1 Like

Thanks for the info.

I added this but it seems that the workflow returns the error “[error]Cannot read property ‘author’ of undefined”.

My guess is that this is because of webhook changes to Discord?

I contacted the dev of the Action and see if I get any response.