Skip to content

Commit

Permalink
remove leading slash and escaping slash
Browse files Browse the repository at this point in the history
  • Loading branch information
amenocal committed Mar 29, 2024
1 parent 06c6347 commit 8048ae4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gh-repo-stats
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Header() {
# Validate we can hit the endpoint by getting the current user #
################################################################
if [[ ${GITHUB_TOKEN_TYPE} == "user" ]]; then
USER_DATA=$(gh api "/user")
USER_DATA=$(gh api user)
ERROR_CODE=$?

#######################
Expand All @@ -249,7 +249,7 @@ Header() {
# Check GHE version #
#####################
if [[ "$(isCloud)" -eq 0 ]]; then
META_DATA=$(gh api "/meta")
META_DATA=$(gh api meta)
ERROR_CODE=$?

#######################
Expand Down Expand Up @@ -471,7 +471,7 @@ CheckAdminRights() {
##################
# Get membership #
##################
MEMBERSHIP_DATA=$(gh api "/orgs/${ORG_NAME}/memberships/${USER_LOGIN}")
MEMBERSHIP_DATA=$(gh api orgs/${ORG_NAME}/memberships/${USER_LOGIN})
ERROR_CODE=$?

if [ "${ERROR_CODE}" -ne 0 ]; then
Expand All @@ -493,7 +493,7 @@ CheckAdminRights() {
################################################################################
#### Function isGHEC ###########################################################
isCloud() {
ROOT_DATA=$(gh api "/")
ROOT_DATA=$(gh api //)
USER_URL=$(echo -n "${ROOT_DATA}" | jq -r '.current_user_url')

if [[ "${USER_URL}" != "https://api.github.com/user" ]]; then
Expand Down Expand Up @@ -560,7 +560,7 @@ CheckAPILimit() {
##############################################################
# Check what is remaining, and if 0, we need to sleep it off #
##############################################################
API_REMAINING_REQUEST=$(gh api "/rate_limit")
API_REMAINING_REQUEST=$(gh api rate_limit)
API_REMAINING_MESSAGE=$(echo "${API_REMAINING_REQUEST}" | jq -r '.message' 2>&1)

if [[ "${API_REMAINING_MESSAGE}" != "Rate limiting is not enabled." ]]; then
Expand Down

0 comments on commit 8048ae4

Please sign in to comment.