First it gets the SHA of a branch.
Second it gets the last commit that changed a particular file on that branch, passing the sha it just got so it's on the right branch.
However, https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits--parameters says "sha string - SHA or branch to start listing commits from. Default: the repository’s default branch (usually main)."
This implies we can just pass branch var straight to sha paramater in the second API call and skip the first one.
First it gets the SHA of a branch.
Second it gets the last commit that changed a particular file on that branch, passing the sha it just got so it's on the right branch.
However, https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits--parameters says "sha string - SHA or branch to start listing commits from. Default: the repository’s default branch (usually main)."
This implies we can just pass branch var straight to sha paramater in the second API call and skip the first one.