GitHub Actions enable access to the commit message via the 'github.event.head_commit.message' property, providing the entire message with title and body. Developers can retrieve the message using this property or through the 'GITHUB_HEAD_COMMIT_MESSA
In GitHub Actions, you can access the commit message using the github.event.head_commit.message
property. This property contains the full commit message, including the title and body.
To retrieve the commit message within a GitHub action, you can use the following syntax:
<code>echo "${{ github.event.head_commit.message }}"</code>
This will output the commit message to the console.
Yes, you can access the commit message in a GitHub action workflow using the env
property. The env
property contains a list of environment variables that are available to your workflow. The commit message is available as the GITHUB_HEAD_COMMIT_MESSAGE
environment variable.
To access the commit message using the env
property, you can use the following syntax:
<code>echo "${{ env.GITHUB_HEAD_COMMIT_MESSAGE }}"</code>
This will output the commit message to the console.
The above is the detailed content of how to get commit message in github actions. For more information, please follow other related articles on the PHP Chinese website!