Skip to content

Commit dcec384

Browse files
committed
Avoid hardcoding github.com
1 parent d085674 commit dcec384

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const core = require('@actions/core');
55
const Codeowners = require('codeowners');
66
const {readFileSync} = require("fs");
77

8+
const githubServerUrl = process.env['GITHUB_SERVER_URL'] || 'https://github.com'
9+
810
// Effectively the main function
911
async function run() {
1012
core.info("Running version 1.6.5")
@@ -118,7 +120,7 @@ ${ourSignature}`
118120
* @param {string[]} files
119121
*/
120122
function pathListToMarkdown(files) {
121-
return files.map(i => `* [\`${i}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/HEAD${encodeURIComponent(i)})`).join("\n");
123+
return files.map(i => `* [\`${i}\`](${githubServerUrl}/${context.repo.owner}/${context.repo.repo}/tree/HEAD${encodeURIComponent(i)})`).join("\n");
122124
}
123125

124126
function getPayloadBody() {
@@ -215,7 +217,7 @@ class Actor {
215217
core.error(error)
216218
core.setFailed("Failed to merge")
217219

218-
const linkToCI = `https://github.com/${thisRepo.owner}/${thisRepo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}?check_suite_focus=true`
220+
const linkToCI = `${githubServerUrl}/${thisRepo.owner}/${thisRepo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}?check_suite_focus=true`
219221
await octokit.issues.createComment({ ...thisRepo, issue_number: issue.number, body: `There was an issue merging, maybe try again ${sender}. <a href="${linkToCI}">Details</a>` });
220222
}
221223
}

0 commit comments

Comments
 (0)