|
|
@ -4149,7 +4149,7 @@ function run() {
|
|
|
|
var _a, _b;
|
|
|
|
var _a, _b;
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const sourceSettings = inputHelper.getInputs();
|
|
|
|
const sourceSettings = yield inputHelper.getInputs();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Register problem matcher
|
|
|
|
// Register problem matcher
|
|
|
|
coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
|
|
|
|
coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
|
|
|
@ -6542,6 +6542,7 @@ function createAuthHelper(git, settings) {
|
|
|
|
exports.createAuthHelper = createAuthHelper;
|
|
|
|
exports.createAuthHelper = createAuthHelper;
|
|
|
|
class GitAuthHelper {
|
|
|
|
class GitAuthHelper {
|
|
|
|
constructor(gitCommandManager, gitSourceSettings) {
|
|
|
|
constructor(gitCommandManager, gitSourceSettings) {
|
|
|
|
|
|
|
|
this.insteadOfValues = [];
|
|
|
|
this.sshCommand = '';
|
|
|
|
this.sshCommand = '';
|
|
|
|
this.sshKeyPath = '';
|
|
|
|
this.sshKeyPath = '';
|
|
|
|
this.sshKnownHostsPath = '';
|
|
|
|
this.sshKnownHostsPath = '';
|
|
|
@ -6557,7 +6558,10 @@ class GitAuthHelper {
|
|
|
|
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
|
|
|
|
this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
|
|
|
|
// Instead of SSH URL
|
|
|
|
// Instead of SSH URL
|
|
|
|
this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
|
|
|
|
this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
|
|
|
|
this.insteadOfValue = `git@${serverUrl.hostname}:`;
|
|
|
|
this.insteadOfValues.push(`git@${serverUrl.hostname}:`);
|
|
|
|
|
|
|
|
if (this.settings.workflowOrganizationId) {
|
|
|
|
|
|
|
|
this.insteadOfValues.push(`org-${this.settings.workflowOrganizationId}@github.com:`);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
configureAuth() {
|
|
|
|
configureAuth() {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
@ -6606,7 +6610,9 @@ class GitAuthHelper {
|
|
|
|
// Configure HTTPS instead of SSH
|
|
|
|
// Configure HTTPS instead of SSH
|
|
|
|
yield this.git.tryConfigUnset(this.insteadOfKey, true);
|
|
|
|
yield this.git.tryConfigUnset(this.insteadOfKey, true);
|
|
|
|
if (!this.settings.sshKey) {
|
|
|
|
if (!this.settings.sshKey) {
|
|
|
|
yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
|
|
|
|
for (const insteadOfValue of this.insteadOfValues) {
|
|
|
|
|
|
|
|
yield this.git.config(this.insteadOfKey, insteadOfValue, true, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (err) {
|
|
|
|
catch (err) {
|
|
|
@ -6638,7 +6644,9 @@ class GitAuthHelper {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
// Configure HTTPS instead of SSH
|
|
|
|
// Configure HTTPS instead of SSH
|
|
|
|
yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
|
|
|
|
for (const insteadOfValue of this.insteadOfValues) {
|
|
|
|
|
|
|
|
yield this.git.submoduleForeach(`git config --local --add '${this.insteadOfKey}' '${insteadOfValue}'`, this.settings.nestedSubmodules);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -6928,14 +6936,14 @@ class GitCommandManager {
|
|
|
|
yield this.execGit(args);
|
|
|
|
yield this.execGit(args);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
config(configKey, configValue, globalConfig) {
|
|
|
|
config(configKey, configValue, globalConfig, add) {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
yield this.execGit([
|
|
|
|
const args = ['config', globalConfig ? '--global' : '--local'];
|
|
|
|
'config',
|
|
|
|
if (add) {
|
|
|
|
globalConfig ? '--global' : '--local',
|
|
|
|
args.push('--add');
|
|
|
|
configKey,
|
|
|
|
}
|
|
|
|
configValue
|
|
|
|
args.push(...[configKey, configValue]);
|
|
|
|
]);
|
|
|
|
yield this.execGit(args);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
configExists(configKey, globalConfig) {
|
|
|
|
configExists(configKey, globalConfig) {
|
|
|
@ -13522,6 +13530,75 @@ module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = require("net");
|
|
|
|
module.exports = require("net");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ 642:
|
|
|
|
|
|
|
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
|
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
|
|
|
|
|
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
|
|
|
|
|
|
}) : function(o, v) {
|
|
|
|
|
|
|
|
o["default"] = v;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
|
|
|
|
var result = {};
|
|
|
|
|
|
|
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
|
|
|
__setModuleDefault(result, mod);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
|
|
|
|
exports.getOrganizationId = void 0;
|
|
|
|
|
|
|
|
const core = __importStar(__webpack_require__(470));
|
|
|
|
|
|
|
|
const fs = __importStar(__webpack_require__(747));
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Gets the organization ID of the running workflow or undefined if the value cannot be loaded from the GITHUB_EVENT_PATH
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function getOrganizationId() {
|
|
|
|
|
|
|
|
var _a, _b;
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const eventPath = process.env.GITHUB_EVENT_PATH;
|
|
|
|
|
|
|
|
if (!eventPath) {
|
|
|
|
|
|
|
|
core.debug(`GITHUB_EVENT_PATH is not defined`);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const content = yield fs.promises.readFile(eventPath, { encoding: 'utf8' });
|
|
|
|
|
|
|
|
const event = JSON.parse(content);
|
|
|
|
|
|
|
|
const id = (_b = (_a = event === null || event === void 0 ? void 0 : event.repository) === null || _a === void 0 ? void 0 : _a.owner) === null || _b === void 0 ? void 0 : _b.id;
|
|
|
|
|
|
|
|
if (typeof id !== 'number') {
|
|
|
|
|
|
|
|
core.debug('Repository owner ID not found within GITHUB event info');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (err) {
|
|
|
|
|
|
|
|
core.debug(`Unable to load organization ID from GITHUB_EVENT_PATH: ${err
|
|
|
|
|
|
|
|
.message || err}`);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getOrganizationId = getOrganizationId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
/***/ 649:
|
|
|
|
/***/ 649:
|
|
|
@ -17062,13 +17139,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
__setModuleDefault(result, mod);
|
|
|
|
__setModuleDefault(result, mod);
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
|
|
|
|
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
|
|
|
|
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
|
|
|
|
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
|
|
|
|
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
|
|
|
|
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
|
|
|
|
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.getInputs = void 0;
|
|
|
|
exports.getInputs = void 0;
|
|
|
|
const core = __importStar(__webpack_require__(470));
|
|
|
|
const core = __importStar(__webpack_require__(470));
|
|
|
|
const fsHelper = __importStar(__webpack_require__(618));
|
|
|
|
const fsHelper = __importStar(__webpack_require__(618));
|
|
|
|
const github = __importStar(__webpack_require__(469));
|
|
|
|
const github = __importStar(__webpack_require__(469));
|
|
|
|
const path = __importStar(__webpack_require__(622));
|
|
|
|
const path = __importStar(__webpack_require__(622));
|
|
|
|
|
|
|
|
const workflowContextHelper = __importStar(__webpack_require__(642));
|
|
|
|
function getInputs() {
|
|
|
|
function getInputs() {
|
|
|
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
const result = {};
|
|
|
|
const result = {};
|
|
|
|
// GitHub workspace
|
|
|
|
// GitHub workspace
|
|
|
|
let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
|
|
|
|
let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
|
|
|
@ -17154,7 +17242,10 @@ function getInputs() {
|
|
|
|
// Persist credentials
|
|
|
|
// Persist credentials
|
|
|
|
result.persistCredentials =
|
|
|
|
result.persistCredentials =
|
|
|
|
(core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
|
|
|
|
(core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
|
|
|
|
|
|
|
|
// Workflow organization ID
|
|
|
|
|
|
|
|
result.workflowOrganizationId = yield workflowContextHelper.getOrganizationId();
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.getInputs = getInputs;
|
|
|
|
exports.getInputs = getInputs;
|
|
|
|
|
|
|
|
|
|
|
|