Skip to content

Commit

Permalink
Add support for GITHUB_TOKEN as repo_token
Browse files Browse the repository at this point in the history
According to [1], "Coveralls expects to receive a github-token parameter to use for updating the build status."

[1] lemurheavy/coveralls-public#1353 (comment)
  • Loading branch information
fniephaus authored Aug 5, 2020
1 parent b478107 commit e687209
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export_coveralls_data() {
local branch_name="unknown"
local url="unknown"
local job_id="unknown"
local repo_token="${COVERALLS_REPO_TOKEN:-}"
local repo_token=""

if is_travis_build; then
service_name="travis-ci"
Expand All @@ -383,10 +383,12 @@ export_coveralls_data() {
branch_name="${GITHUB_REF}"
url="https://github.com/${GITHUB_REPOSITORY}.git"
job_id="${GITHUB_RUN_NUMBER}"
repo_token="${GITHUB_TOKEN:-}"
fi

if is_not_empty "${repo_token}"; then
if is_not_empty "${COVERALLS_REPO_TOKEN:-}"; then
print_info 'Using $COVERALLS_REPO_TOKEN instead of CI service info...'
repo_token="${COVERALLS_REPO_TOKEN:-}"
service_name=""
job_id=""
fi
Expand Down

0 comments on commit e687209

Please sign in to comment.