Skip to content

Commit

Permalink
Merge pull request #3556 from scala-steward-org/topic/update-gh-api-l…
Browse files Browse the repository at this point in the history
…inks

Update links to the GitHub REST API docs
  • Loading branch information
fthomas authored Jan 21, 2025
2 parents 9813e68 + 14eb257 commit 30e1311
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ final class GitHubApiAlg[F[_]](
} yield ()
}

/** https://docs.github.com/en/rest/repos/branches?apiVersion=2022-11-28#get-branch */
/** https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#get-a-branch */
override def getBranch(repo: Repo, branch: Branch): F[BranchOut] =
client.get(url.branches(repo, branch), modify)

/** https://docs.github.com/en/rest/repos?apiVersion=2022-11-28#get */
/** https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository */
override def getRepo(repo: Repo): F[RepoOut] =
client.get[RepoOut](url.repos(repo), modify).flatTap { repoOut =>
F.raiseWhen(repoOut.archived)(RepositoryArchived(repo))
Expand All @@ -103,15 +103,16 @@ final class GitHubApiAlg[F[_]](
override def listPullRequests(repo: Repo, head: String, base: Branch): F[List[PullRequestOut]] =
client.get(url.listPullRequests(repo, head, base), modify)

/** https://docs.github.com/en/rest/pulls?apiVersion=2022-11-28#update-a-pull-request */
/** https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request */
override def closePullRequest(repo: Repo, number: PullRequestNumber): F[PullRequestOut] =
client.patchWithBody[PullRequestOut, UpdateState](
url.pull(repo, number),
UpdateState(PullRequestState.Closed),
modify
)

/** https://docs.github.com/en/rest/issues?apiVersion=2022-11-28#create-an-issue-comment */
/** https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
*/
override def commentPullRequest(
repo: Repo,
number: PullRequestNumber,
Expand All @@ -120,8 +121,7 @@ final class GitHubApiAlg[F[_]](
client
.postWithBody(url.comments(repo, number), Comment(comment), modify)

/** https://docs.github.com/en/rest/reference/issues?apiVersion=2022-11-28#add-labels-to-an-issue
*/
/** https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue */
private def labelPullRequest(
repo: Repo,
number: PullRequestNumber,
Expand Down

0 comments on commit 30e1311

Please sign in to comment.