Skip to content

Commit

Permalink
Causes the correct server URL to be set in GitHub Actions. (#131)
Browse files Browse the repository at this point in the history
* Causes the correct server URL to be set in GitHub Actions.

Signed-off-by: Debayan De <[email protected]>

* test: update to use the env

Co-authored-by: Joe Becher <[email protected]>
  • Loading branch information
debayande and drazisil-codecov authored Jun 10, 2021
1 parent fbf3c33 commit e7b9fb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ci_providers/provider_githubactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`
)
}

Expand Down
5 changes: 5 additions & 0 deletions test/providers/provider_githubactions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down Expand Up @@ -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',
}
Expand Down Expand Up @@ -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',
}
Expand Down Expand Up @@ -159,6 +162,7 @@ describe('GitHub Actions Params', () => {
},
envs: {
GITHUB_ACTIONS: true,
GITHUB_SERVER_URL: 'https://github.com',
}
}
const expected = {
Expand Down Expand Up @@ -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',
}
Expand Down

0 comments on commit e7b9fb1

Please sign in to comment.