Skip to content

Commit 6af9968

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const { context, getOctokit } = require('@actions/github')
44
const core = require('@actions/core');
55
const Codeowners = require('codeowners');
66
const {readFileSync} = require("fs");
7+
const githubDotCom = process.env['GITHUB_SERVER_URL'] || 'https://github.com'
78

89
// Effectively the main function
910
async function run() {
@@ -118,7 +119,7 @@ ${ourSignature}`
118119
* @param {string[]} files
119120
*/
120121
function pathListToMarkdown(files) {
121-
return files.map(i => `* [\`${i}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/HEAD${encodeURIComponent(i)})`).join("\n");
122+
return files.map(i => `* [\`${i}\`](${githubDotCom}/${context.repo.owner}/${context.repo.repo}/tree/HEAD${encodeURIComponent(i)})`).join("\n");
122123
}
123124

124125
function getPayloadBody() {
@@ -215,7 +216,7 @@ class Actor {
215216
core.error(error)
216217
core.setFailed("Failed to merge")
217218

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

0 commit comments

Comments
 (0)