Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion labeler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ DESCRIPTION

OPTIONS
-b, --bulkUpdate
Update all repositories under GHE owner organization. Can only be used with a GitHub Enterprise host.
Update all repositories under the specified owner. Works for both GitHub users and GitHub Enterprise organizations.

-c, --config
Launch interactive CLI to store data into config. Storing empty strings removes data from config.
Expand Down
6 changes: 4 additions & 2 deletions lib/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export function deleteLabel(exit, token, label) {
// Gets headers from request to list all repos for an organization
export function headRepoList(exit, token, owner, host, perPage) {
// Variables
let url = `https://${host}/api/v3/orgs/${owner}/repos?sort=full_name&per_page=${perPage}`
const pathPrefix = host === pkg.labeler.defaultHost ? '/users' : '/api/v3/orgs'
let url = `https://${host}${pathPrefix}/${owner}/repos?sort=full_name&per_page=${perPage}`

// HEAD request
return Axios
Expand Down Expand Up @@ -141,7 +142,8 @@ export function headRepoList(exit, token, owner, host, perPage) {
// Gets the "pageNum" page of the repos list with up to "perPage" records
export function getReposByPage(exit, token, owner, host, pageNum, perPage) {
// Variables
let url = `https://${host}/api/v3/orgs/${owner}/repos?sort=full_name&page=${pageNum}&per_page=${perPage}`
const pathPrefix = host === pkg.labeler.defaultHost ? '/users' : '/api/v3/orgs'
let url = `https://${host}${pathPrefix}/${owner}/repos?sort=full_name&page=${pageNum}&per_page=${perPage}`

// Get request
return Axios
Expand Down