From 6cc367621f10de0549fb0f589c8d6b814f4928cf Mon Sep 17 00:00:00 2001 From: ibrahim0814 Date: Tue, 4 Feb 2020 12:31:45 -0600 Subject: [PATCH] add run id and build url --- codecov | 2 ++ env | 1 + tests/env | 1 + tests/test | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/codecov b/codecov index f015a1c0..b3bd9cf3 100755 --- a/codecov +++ b/codecov @@ -771,6 +771,8 @@ then branch="${GITHUB_REF#refs/heads/}" commit="${GITHUB_SHA}" slug="${GITHUB_REPOSITORY}" + build="${GITHUB_RUN_ID}" + build_url=$(urlencode "http://github.com/${GITHUB_REPOSITORY}/runs/${GITHUB_RUN_ID}") elif [ "$SYSTEM_TEAMFOUNDATIONSERVERURI" != "" ]; then diff --git a/env b/env index da0c8456..43d4cf7d 100755 --- a/env +++ b/env @@ -237,6 +237,7 @@ then add "GITHUB_REF" add "GITHUB_REPOSITORY" add "GITHUB_SHA" + add "GITHUB_RUN_ID" elif [ "$CI" = "true" ] && [ "$BITBUCKET_BUILD_NUMBER" != "" ]; then diff --git a/tests/env b/tests/env index 28deaf19..e2e93943 100644 --- a/tests/env +++ b/tests/env @@ -64,6 +64,7 @@ export GIT_BRANCH="" export GIT_COMMIT="" export GITHUB_REF="" export GITHUB_REPOSITORY="" +export GITHUB_RUN_ID="" export GITHUB_SHA="" export GITLAB_CI="" export JENKINS_URL="" diff --git a/tests/test b/tests/test index c4346793..b1bf1074 100755 --- a/tests/test +++ b/tests/test @@ -338,9 +338,10 @@ function test_github_action () { export GITHUB_ACTION="my-fancy-github-action" export GITHUB_REF="refs/heads/master" export GITHUB_REPOSITORY="codecov/ci-repo" + export GITHUB_RUN_ID="32402849" export GITHUB_SHA="$TEST_DATA_GIT_COMMIT" - assertURL "https://codecov.io/upload/v4?package=bash-$VERSION&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=&build_url=&name=&tag=&slug=codecov%2Fci-repo&service=github-actions&flags=&pr=&job=" + assertURL "https://codecov.io/upload/v4?package=bash-$VERSION&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=32402849&build_url=http%3A%2F%2Fgithub.com%2Fcodecov%2Fci-repo%2Fruns%2F32402849&name=&tag=&slug=codecov%2Fci-repo&service=github-actions&flags=&pr=&job=" } function test_semaphore (){