We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ac4f76c + f29ba53 commit 1e9a11aCopy full SHA for 1e9a11a
codacy-cli.sh
@@ -65,7 +65,11 @@ fi
65
66
# if no version is specified, we fetch the latest
67
if [ -z "$CODACY_CLI_V2_VERSION" ]; then
68
- CODACY_CLI_V2_VERSION="$(curl -Lq "https://api.github.com/repos/codacy/codacy-cli-v2/releases/latest" 2>/dev/null | grep -m 1 tag_name | cut -d'"' -f4)"
+ if [ -n "$GH_TOKEN" ]; then
69
+ CODACY_CLI_V2_VERSION="$(curl -Lq --header "Authorization: Bearer $GH_TOKEN" "https://api.github.com/repos/codacy/codacy-cli-v2/releases/latest" 2>/dev/null | grep -m 1 tag_name | cut -d'"' -f4)"
70
+ else
71
+ CODACY_CLI_V2_VERSION="$(curl -Lq "https://api.github.com/repos/codacy/codacy-cli-v2/releases/latest" 2>/dev/null | grep -m 1 tag_name | cut -d'"' -f4)"
72
+ fi
73
fi
74
75
# Folder containing the binary
0 commit comments