I'm using Probot's Octokit to read a file from a repo:
const content = await context.octokit.repos.getContent({owner: "OWNER", repo: "REPO", path:"PATH"})
However this only works for the master branch, is there a way to get the file from another branch (e.g. the branch that the pull request action is coming from)? This isn't directly stated in the docs itself.
Thanks
Yes, it is possible.
When using Octokit, there is an optional parameter:
ref
where you can specify the branch or commit hash. You can find the reference here.