it would really be helpful, since that the commit on the target branch of the PR, the commits list available is from the origin branch that is coming from a fork, and even gonna be delete later, so it leaves pointing to dangling commit that are much less helpful
even this isn't enough, since there not way inside the jinja template to execute more api call, to retrieve the rest of the patchset commits
here's a bash script I'm using to retrieve the list of commit of the target branch of a PR (after it was merged):
function get_pr_commits() {
PR_NUM=$1
MERGE_COMMIT=$(gh pr view $PR_NUM --json mergeCommit | jq -r '.mergeCommit.oid')
PR_COMMITS=""
commit=$MERGE_COMMIT
while :
do
COMMIT_PR=$(gh api /repos/{owner}/{repo}/commits/$commit/pulls | jq -r '.[].number')
if [[ $COMMIT_PR == $PR_NUM ]]; then
PR_COMMITS="$PR_COMMITS $commit"
FOUND_FIRST=yes
fi
if [[ $COMMIT_PR != $PR_NUM ]] && [[ ! -z $FOUND_FIRST ]]; then
break
fi
commit=$(gh api /repos/{owner}/{repo}/commits/$commit | jq -r '.parents[0].sha')
done
echo $(reverse $PR_COMMITS)
}
a way to get something equivalent would be really helpful
mergeCommit
is missing from the PR attribute listhttps://docs.mergify.com/configuration/conditions/#attributes-list
in github api it called
merge_commit_sha
https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-requestin via gh cli:
it would really be helpful, since that the commit on the target branch of the PR, the
commits
list available is from the origin branch that is coming from a fork, and even gonna be delete later, so it leaves pointing to dangling commit that are much less helpfuleven this isn't enough, since there not way inside the jinja template to execute more api call, to retrieve the rest of the patchset commits
here's a bash script I'm using to retrieve the list of commit of the target branch of a PR (after it was merged):
a way to get something equivalent would be really helpful