Parse ${{ github.event.head_commit.message }}

I suspect it’s a RegEx process I think, but I struggle with RegEx.

How I would split the words (the first word actually) out of the ‘commit message.’

${{ github.event.head_commit.message }} <---- parse out its first word.

Goes to an environment variable from what I’ve read, and then I can assign it to a ‘tag_name’ in a workflow, you see:

tag_name: ${{ steps.get_version.outputs.TAG_NAME }}


Would this be the right idea? I haven’t the means to test it right now, but am I on the right track?:

      - id: get-tag
        run: |
          id=$(echo ${{github.event.head_commit.message}} | cut -d- -f1)
          echo "::set-output name=tag::$id"

…and then would the rest of this would work out??

 # Create a Release up on Github
      - uses: actions/create-release@v1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
          tag_name: ${{steps.get-tag.outputs.tag}}
          release_name: Release ${{steps.get-tag.outputs.tag}}
#          body_path:
          body: |
          draft: false
          prerelease: false

Reference: Substring function?