From e7b9fb1aeceaa97240e471d3cda171ba5e8cbbf4 Mon Sep 17 00:00:00 2001 From: Debayan De Date: Thu, 10 Jun 2021 19:12:25 +0100 Subject: [PATCH] Causes the correct server URL to be set in GitHub Actions. (#131) * Causes the correct server URL to be set in GitHub Actions. Signed-off-by: Debayan De * test: update to use the env Co-authored-by: Joe Becher <71270647+drazisil-codecov@users.noreply.github.com> --- src/ci_providers/provider_githubactions.js | 2 +- test/providers/provider_githubactions.test.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ci_providers/provider_githubactions.js b/src/ci_providers/provider_githubactions.js index c304208a3..693d1086d 100644 --- a/src/ci_providers/provider_githubactions.js +++ b/src/ci_providers/provider_githubactions.js @@ -13,7 +13,7 @@ function _getBuild (inputs) { function _getBuildURL (inputs) { const { args, envs } = inputs return encodeURIComponent( - `https://github.com/${_getSlug(inputs)}/actions/runs/${_getBuild(inputs)}` + `${envs.GITHUB_SERVER_URL}/${_getSlug(inputs)}/actions/runs/${_getBuild(inputs)}` ) } diff --git a/test/providers/provider_githubactions.test.js b/test/providers/provider_githubactions.test.js index 34683b852..43d516df1 100644 --- a/test/providers/provider_githubactions.test.js +++ b/test/providers/provider_githubactions.test.js @@ -66,6 +66,7 @@ describe('GitHub Actions Params', () => { GITHUB_REF: 'refs/heads/master', GITHUB_REPOSITORY: 'testOrg/testRepo', GITHUB_RUN_ID: 2, + GITHUB_SERVER_URL: 'https://github.com', GITHUB_SHA: 'testingsha', GITHUB_WORKFLOW: 'testWorkflow', } @@ -93,6 +94,7 @@ describe('GitHub Actions Params', () => { GITHUB_REF: 'refs/pull/1/merge', GITHUB_REPOSITORY: 'testOrg/testRepo', GITHUB_RUN_ID: 2, + GITHUB_SERVER_URL: 'https://github.com', GITHUB_SHA: 'testingsha', GITHUB_WORKFLOW: 'testWorkflow', } @@ -125,6 +127,7 @@ describe('GitHub Actions Params', () => { GITHUB_REF: 'refs/pull/1/merge', GITHUB_REPOSITORY: 'testOrg/testRepo', GITHUB_RUN_ID: 2, + GITHUB_SERVER_URL: 'https://github.com', GITHUB_SHA: 'testingmergecommitsha', GITHUB_WORKFLOW: 'testWorkflow', } @@ -159,6 +162,7 @@ describe('GitHub Actions Params', () => { }, envs: { GITHUB_ACTIONS: true, + GITHUB_SERVER_URL: 'https://github.com', } } const expected = { @@ -189,6 +193,7 @@ describe('GitHub Actions Params', () => { GITHUB_REF: 'refs/pull/1/merge', GITHUB_REPOSITORY: 'testOrg/testRepo', GITHUB_RUN_ID: 2, + GITHUB_SERVER_URL: 'https://github.com', GITHUB_SHA: 'testingsha', GITHUB_WORKFLOW: 'testWorkflow', }