Skip to content

How to get commit message on pull_request workflow? #28474

Discussion options

You must be logged in to vote

So I would be thankful if anyone knows how I can solve this.

The first question to answer here is: Which commit(s) do you want to look at? Only the head commit of the pull request branch? All commits on the branch (which could be many)?

github.event.pull_request.head.sha should give you the ID of the head commit, github.event.pull_request.base.sha that of the base (target) branch (in case you want to look at all commits).

Note that you'll have to tell actions/checkout to download more than the latest commit if you want to inspect those, or fetch the relevant part of history in your workflow. The triggering commit for pull_request events is a temporary merge commit, so it's none of your …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@gabrielbahniuk
Comment options

@airtower-luna
Comment options

@gabrielbahniuk
Comment options

@airtower-luna
Comment options

@ILikePlayingGames
Comment options

Answer selected by gabrielbahniuk
Comment options

You must be logged in to vote
2 replies
@airtower-luna
Comment options

@mustafabahaa
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants