How to get commit message on pull_request workflow? #28474
-
Hi there, i have some jobs running when people open pull request, so it starts like this:
In I ended up adding the following to e2e_tests_A:
According to the following urls, it won't work because I can only have https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request I know Github has already some keywords like [skip ci] and similar but I want to define my own keywords to the commit message. Also, according to my searches, So I would be thankful if anyone knows how I can solve this. Thanks in advance!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
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)?
Note that you'll have to tell |
Beta Was this translation helpful? Give feedback.
-
Sorry but I'm confused, in the solution purposed we checkout the last commit on the branch to get the commit message, we are not checking the merge commit, testing the last commit on the pull request branch and testing on merge commit is different, and it may introduce other issue after merging because we didn't test the merge commit, am i missing something ? |
Beta Was this translation helpful? Give feedback.
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 forpull_request
events is a temporary merge commit, so it's none of your …