mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-27 19:23:56 +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);
|
const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = __webpack_require__(972);
|
||||||
|
|
||||||
try {
|
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 escapedDomain = instanceDomain.replace(/[-.]/g, '\\$&');
|
||||||
const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i');
|
const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i');
|
||||||
|
|
||||||
|
@ -394,7 +395,7 @@ try {
|
||||||
console.log('Configuring deployment key(s)');
|
console.log('Configuring deployment key(s)');
|
||||||
|
|
||||||
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
|
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);
|
const parts = key.match(regexDomain);
|
||||||
|
|
||||||
if (!parts) {
|
if (!parts) {
|
||||||
|
|
5
index.js
5
index.js
|
@ -5,7 +5,8 @@ const crypto = require('crypto');
|
||||||
const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = require('./paths.js');
|
const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = require('./paths.js');
|
||||||
|
|
||||||
try {
|
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 escapedDomain = instanceDomain.replace(/[-.]/g, '\\$&');
|
||||||
const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i');
|
const regexDomain = new RegExp(`\\b${escapedDomain}[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)`, 'i');
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@ try {
|
||||||
console.log('Configuring deployment key(s)');
|
console.log('Configuring deployment key(s)');
|
||||||
|
|
||||||
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
|
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);
|
const parts = key.match(regexDomain);
|
||||||
|
|
||||||
if (!parts) {
|
if (!parts) {
|
||||||
|
|
Loading…
Reference in a new issue