GitHub Action Get Commit Message

You can get this in the github context for the action, as described here.

The event key will give you the webhook content, as defined here.

So, for your action, you can use something like:

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

You can get the concrete commit message with the following command:

github.event.head_commit.message

Or it is possible to get the commit messages with the git log command if you use bash:

git log -1 --pretty=format:"%s"

Update: With regard to the documentation, the payload and thus also the call of the commit message can get with the commits array if there is only one commit. The message can be fetched with the following line in the GitHub action:

github.event.commits[0].message