diff --git a/dist/index.js b/dist/index.js index a716d59..f8d6ed7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -341,7 +341,8 @@ const crypto = __webpack_require__(417); const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = __webpack_require__(972); try { - const instanceDomain = core.getInput('instance-domain', {default: 'github.com'}); + const instanceURL = core.getInput('instance-url') || process.env.GITHUB_SERVER_URL || 'https://github.com'; + const instanceDomain = instanceURL.replace(/^https?:\/\//, ''); const escapedDomain = instanceDomain.replace(/[-.]/g, '\\$&'); const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i'); @@ -394,7 +395,7 @@ try { console.log('Configuring deployment key(s)'); child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) { - console.log('Domain regular expression is:', regexDomain); + console.log('Instance domain is:', instanceDomain); const parts = key.match(regexDomain); if (!parts) { diff --git a/index.js b/index.js index 915c3e6..8c90eac 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,8 @@ const crypto = require('crypto'); const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = require('./paths.js'); try { - const instanceDomain = core.getInput('instance-domain', {default: 'github.com'}); + const instanceURL = core.getInput('instance-url') || process.env.GITHUB_SERVER_URL || 'https://github.com'; + const instanceDomain = instanceURL.replace(/^https?:\/\//, ''); const escapedDomain = instanceDomain.replace(/[-.]/g, '\\$&'); const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i'); @@ -58,7 +59,7 @@ try { console.log('Configuring deployment key(s)'); child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) { - console.log('Domain regular expression is:', regexDomain); + console.log('Instance domain is:', instanceDomain); const parts = key.match(regexDomain); if (!parts) {