Skip to content

Commit

Permalink
added .api_url arguements to all gh calls
Browse files Browse the repository at this point in the history
  • Loading branch information
wes-a2ai committed Nov 12, 2024
1 parent c865e4e commit d146673
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/get_org_attributes.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ filter_for_non_empty_milestones <- function(milestones) {
}

filter_for_ghqc_milestones <- function(owner, repo, milestones) {
labels <- sapply(milestones, function(x) gh::gh("GET /repos/:owner/:repo/milestones/:milestone_number/labels", owner = owner, repo = repo, milestone_number = x$number))
labels <- sapply(milestones, function(x) gh::gh("GET /repos/:owner/:repo/milestones/:milestone_number/labels", owner = owner, repo = repo, milestone_number = x$number), .api_url = .le$github_api_url)
milestones[sapply(labels, function(x) "ghqc" %in% sapply(x, function(y) y$name))]
}

Expand Down
9 changes: 6 additions & 3 deletions R/multi_issue.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ create_issue <- function(file, issue_params) {
label_params <- list(owner = issue_params$owner,
repo = issue_params$repo,
issue_number = issue$number,
labels = array("ghqc"))
labels = array("ghqc"),
.api_url = .le$github_api_url)
label <- do.call(gh::gh, c("POST /repos/{owner}/{repo}/issues/{issue_number}/labels", label_params))
debug(.le$logger, glue::glue("Label 'ghqc' added to {issue_params$title}"))

Expand Down Expand Up @@ -83,7 +84,8 @@ create_issues <- function(data) {
ghqc_label_exists <- function(data) {
labels <- do.call(gh::gh, c("GET /repos/{owner}/{repo}/labels",
list(owner = data$owner,
repo = data$repo
repo = data$repo,
.api_url = .le$github_api_url
)))
"ghqc" %in% sapply(labels, function(x) x$name)
}
Expand All @@ -95,7 +97,8 @@ create_ghqc_label <- function(data) {
repo = data$repo,
name = "ghqc",
color = "FFCB05",
description = "Issue created by the ghqc package"
description = "Issue created by the ghqc package",
.api_url = .le$github_api_url
)
do.call(gh::gh, c("POST /repos/{owner}/{repo}/labels", issue_params))
}
Expand Down

0 comments on commit d146673

Please sign in to comment.