How to get the description or name from a release in github actions

Viewed 1371

I have read through the documentation for Github actions and the release action, yet I can find nothing on how to get the name from the action. Do I need to run a fetch call or something else?

name: Publish to Bintray

on:
  release:
    types: [published]
  workflow_dispatch:
    

jobs:
  publish:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
    - name: Build with Gradle
      run: ./gradlew curseforge uploadSubProjects publishToModrinth --parallel --stacktrace
      env:
          BINTRAY_USER: oroarmor
          BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
          CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
          MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
1 Answers

You can use github.event.release.name and github.event.release.body:

name: After Release

on:
  release:
    types: [published]

jobs:
  after-release:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Name: ${{ github.event.release.name }} Description: ${{ github.event.release.body }}"
Related