githubgithub-actionsgithub-release

GitHub Actions: user that published a release


Given the GitHub Actions workflow below, how can I get the username of the person who published the release that triggered the workflow?

name: My Workflow

on:
  release:
    types: [ published ]
jobs:
  my-job:
    runs-on: [ my-runner ]

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
       
      - name: Get username of publisher
        run: |
          # HOWTO get username of publisher

Solution

  • You're looking for:

    ${{ github.event.release.author.login }}
    

    See: