mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-24 01:58:01 +00:00
test 2
This commit is contained in:
parent
bc466c9b3a
commit
7ee7a7300f
2 changed files with 6 additions and 4 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -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) {
|
||||
|
|
5
index.js
5
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) {
|
||||
|
|
Loading…
Reference in a new issue