Build a pull/merge request URL from a git remote

Description

Build a pull/merge request URL from a git remote

Usage

pr_request_url(remote_url, source_branch, target_branch)

Arguments

remote_url A git remote URL.
source_branch The source branch name.
target_branch The target branch name.

Value

A URL string that can be used to open a new pull request (GitHub) or merge request (GitLab).

Examples

Code
library("pr.helpers")

pr_request_url(
  "https://github.com/OWNER/REPO.git",
  source_branch = "feature/new-thing",
  target_branch = "main"
)
[1] "https://github.com/OWNER/REPO/compare/main...feature%2Fnew-thing?expand=1"