getPrNumber = () => {
  if (process.env.MOCK_PR_NUMBER) {
    return process.env.MOCK_PR_NUMBER; // For testing purposes.
  }

  const pullRequest = github.context.payload.pull_request;
  if (!pullRequest) {
    throw Error("Could not get pull request number from context");
  }
  return pullRequest.number;
}
Retrieve PR number from the event payload.

@returns {number} PR number.