|
|
|
|
@@ -7711,7 +7711,7 @@ function hashFiles(patterns, currentWorkspace = '', options, verbose = false) {
|
|
|
|
|
followSymbolicLinks = options.followSymbolicLinks;
|
|
|
|
|
}
|
|
|
|
|
const globber = yield create(patterns, { followSymbolicLinks });
|
|
|
|
|
return internal_hash_files_1.hashFiles(globber, currentWorkspace, verbose);
|
|
|
|
|
return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
exports.hashFiles = hashFiles;
|
|
|
|
|
@@ -7726,7 +7726,11 @@ exports.hashFiles = hashFiles;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -7739,7 +7743,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -7754,7 +7758,8 @@ function getOptions(copy) {
|
|
|
|
|
followSymbolicLinks: true,
|
|
|
|
|
implicitDescendants: true,
|
|
|
|
|
matchDirectories: true,
|
|
|
|
|
omitBrokenSymbolicLinks: true
|
|
|
|
|
omitBrokenSymbolicLinks: true,
|
|
|
|
|
excludeHiddenFiles: false
|
|
|
|
|
};
|
|
|
|
|
if (copy) {
|
|
|
|
|
if (typeof copy.followSymbolicLinks === 'boolean') {
|
|
|
|
|
@@ -7773,6 +7778,10 @@ function getOptions(copy) {
|
|
|
|
|
result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;
|
|
|
|
|
core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);
|
|
|
|
|
}
|
|
|
|
|
if (typeof copy.excludeHiddenFiles === 'boolean') {
|
|
|
|
|
result.excludeHiddenFiles = copy.excludeHiddenFiles;
|
|
|
|
|
core.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
@@ -7788,7 +7797,11 @@ exports.getOptions = getOptions;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -7801,7 +7814,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -7855,19 +7868,21 @@ class DefaultGlobber {
|
|
|
|
|
return this.searchPaths.slice();
|
|
|
|
|
}
|
|
|
|
|
glob() {
|
|
|
|
|
var e_1, _a;
|
|
|
|
|
var _a, e_1, _b, _c;
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const result = [];
|
|
|
|
|
try {
|
|
|
|
|
for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {
|
|
|
|
|
const itemPath = _c.value;
|
|
|
|
|
for (var _d = true, _e = __asyncValues(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
|
|
|
_c = _f.value;
|
|
|
|
|
_d = false;
|
|
|
|
|
const itemPath = _c;
|
|
|
|
|
result.push(itemPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
|
|
|
finally {
|
|
|
|
|
try {
|
|
|
|
|
if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);
|
|
|
|
|
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
|
|
|
}
|
|
|
|
|
finally { if (e_1) throw e_1.error; }
|
|
|
|
|
}
|
|
|
|
|
@@ -7925,6 +7940,10 @@ class DefaultGlobber {
|
|
|
|
|
if (!stats) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// Hidden file or directory?
|
|
|
|
|
if (options.excludeHiddenFiles && path.basename(item.path).match(/^\./)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// Directory
|
|
|
|
|
if (stats.isDirectory()) {
|
|
|
|
|
// Matched
|
|
|
|
|
@@ -8030,7 +8049,11 @@ exports.DefaultGlobber = DefaultGlobber;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -8043,7 +8066,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -8072,19 +8095,21 @@ const stream = __importStar(__nccwpck_require__(2781));
|
|
|
|
|
const util = __importStar(__nccwpck_require__(3837));
|
|
|
|
|
const path = __importStar(__nccwpck_require__(1017));
|
|
|
|
|
function hashFiles(globber, currentWorkspace, verbose = false) {
|
|
|
|
|
var e_1, _a;
|
|
|
|
|
var _b;
|
|
|
|
|
var _a, e_1, _b, _c;
|
|
|
|
|
var _d;
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const writeDelegate = verbose ? core.info : core.debug;
|
|
|
|
|
let hasMatch = false;
|
|
|
|
|
const githubWorkspace = currentWorkspace
|
|
|
|
|
? currentWorkspace
|
|
|
|
|
: (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd();
|
|
|
|
|
: (_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd();
|
|
|
|
|
const result = crypto.createHash('sha256');
|
|
|
|
|
let count = 0;
|
|
|
|
|
try {
|
|
|
|
|
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
|
|
|
|
|
const file = _d.value;
|
|
|
|
|
for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
|
|
|
|
|
_c = _g.value;
|
|
|
|
|
_e = false;
|
|
|
|
|
const file = _c;
|
|
|
|
|
writeDelegate(file);
|
|
|
|
|
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
|
|
|
|
|
writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
|
|
|
|
|
@@ -8107,7 +8132,7 @@ function hashFiles(globber, currentWorkspace, verbose = false) {
|
|
|
|
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
|
|
|
finally {
|
|
|
|
|
try {
|
|
|
|
|
if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c);
|
|
|
|
|
if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
|
|
|
|
|
}
|
|
|
|
|
finally { if (e_1) throw e_1.error; }
|
|
|
|
|
}
|
|
|
|
|
@@ -8147,7 +8172,7 @@ var MatchKind;
|
|
|
|
|
MatchKind[MatchKind["File"] = 2] = "File";
|
|
|
|
|
/** Matched */
|
|
|
|
|
MatchKind[MatchKind["All"] = 3] = "All";
|
|
|
|
|
})(MatchKind = exports.MatchKind || (exports.MatchKind = {}));
|
|
|
|
|
})(MatchKind || (exports.MatchKind = MatchKind = {}));
|
|
|
|
|
//# sourceMappingURL=internal-match-kind.js.map
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
@@ -8159,7 +8184,11 @@ var MatchKind;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -8172,7 +8201,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -8222,8 +8251,8 @@ exports.dirname = dirname;
|
|
|
|
|
* or `C:` are expanded based on the current working directory.
|
|
|
|
|
*/
|
|
|
|
|
function ensureAbsoluteRoot(root, itemPath) {
|
|
|
|
|
assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
|
|
|
|
|
assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
|
|
|
|
|
(0, assert_1.default)(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);
|
|
|
|
|
(0, assert_1.default)(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);
|
|
|
|
|
// Already rooted
|
|
|
|
|
if (hasAbsoluteRoot(itemPath)) {
|
|
|
|
|
return itemPath;
|
|
|
|
|
@@ -8233,7 +8262,7 @@ function ensureAbsoluteRoot(root, itemPath) {
|
|
|
|
|
// Check for itemPath like C: or C:foo
|
|
|
|
|
if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) {
|
|
|
|
|
let cwd = process.cwd();
|
|
|
|
|
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
|
|
|
|
(0, assert_1.default)(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
|
|
|
|
// Drive letter matches cwd? Expand to cwd
|
|
|
|
|
if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {
|
|
|
|
|
// Drive only, e.g. C:
|
|
|
|
|
@@ -8258,11 +8287,11 @@ function ensureAbsoluteRoot(root, itemPath) {
|
|
|
|
|
// Check for itemPath like \ or \foo
|
|
|
|
|
else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) {
|
|
|
|
|
const cwd = process.cwd();
|
|
|
|
|
assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
|
|
|
|
(0, assert_1.default)(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);
|
|
|
|
|
return `${cwd[0]}:\\${itemPath.substr(1)}`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
|
|
|
|
|
(0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);
|
|
|
|
|
// Otherwise ensure root ends with a separator
|
|
|
|
|
if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) {
|
|
|
|
|
// Intentionally empty
|
|
|
|
|
@@ -8279,7 +8308,7 @@ exports.ensureAbsoluteRoot = ensureAbsoluteRoot;
|
|
|
|
|
* `\\hello\share` and `C:\hello` (and using alternate separator).
|
|
|
|
|
*/
|
|
|
|
|
function hasAbsoluteRoot(itemPath) {
|
|
|
|
|
assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
|
|
|
|
|
(0, assert_1.default)(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);
|
|
|
|
|
// Normalize separators
|
|
|
|
|
itemPath = normalizeSeparators(itemPath);
|
|
|
|
|
// Windows
|
|
|
|
|
@@ -8296,7 +8325,7 @@ exports.hasAbsoluteRoot = hasAbsoluteRoot;
|
|
|
|
|
* `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator).
|
|
|
|
|
*/
|
|
|
|
|
function hasRoot(itemPath) {
|
|
|
|
|
assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`);
|
|
|
|
|
(0, assert_1.default)(itemPath, `isRooted parameter 'itemPath' must not be empty`);
|
|
|
|
|
// Normalize separators
|
|
|
|
|
itemPath = normalizeSeparators(itemPath);
|
|
|
|
|
// Windows
|
|
|
|
|
@@ -8364,7 +8393,11 @@ exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -8377,7 +8410,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -8402,7 +8435,7 @@ class Path {
|
|
|
|
|
this.segments = [];
|
|
|
|
|
// String
|
|
|
|
|
if (typeof itemPath === 'string') {
|
|
|
|
|
assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`);
|
|
|
|
|
(0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`);
|
|
|
|
|
// Normalize slashes and trim unnecessary trailing slash
|
|
|
|
|
itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);
|
|
|
|
|
// Not rooted
|
|
|
|
|
@@ -8429,24 +8462,24 @@ class Path {
|
|
|
|
|
// Array
|
|
|
|
|
else {
|
|
|
|
|
// Must not be empty
|
|
|
|
|
assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
|
|
|
|
|
(0, assert_1.default)(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);
|
|
|
|
|
// Each segment
|
|
|
|
|
for (let i = 0; i < itemPath.length; i++) {
|
|
|
|
|
let segment = itemPath[i];
|
|
|
|
|
// Must not be empty
|
|
|
|
|
assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`);
|
|
|
|
|
(0, assert_1.default)(segment, `Parameter 'itemPath' must not contain any empty segments`);
|
|
|
|
|
// Normalize slashes
|
|
|
|
|
segment = pathHelper.normalizeSeparators(itemPath[i]);
|
|
|
|
|
// Root segment
|
|
|
|
|
if (i === 0 && pathHelper.hasRoot(segment)) {
|
|
|
|
|
segment = pathHelper.safeTrimTrailingSeparator(segment);
|
|
|
|
|
assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
|
|
|
|
|
(0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);
|
|
|
|
|
this.segments.push(segment);
|
|
|
|
|
}
|
|
|
|
|
// All other segments
|
|
|
|
|
else {
|
|
|
|
|
// Must not contain slash
|
|
|
|
|
assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
|
|
|
|
|
(0, assert_1.default)(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);
|
|
|
|
|
this.segments.push(segment);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -8484,7 +8517,11 @@ exports.Path = Path;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -8497,7 +8534,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -8585,7 +8622,11 @@ exports.partialMatch = partialMatch;
|
|
|
|
|
|
|
|
|
|
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]; } });
|
|
|
|
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
|
|
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
|
|
|
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
|
|
|
}
|
|
|
|
|
Object.defineProperty(o, k2, desc);
|
|
|
|
|
}) : (function(o, m, k, k2) {
|
|
|
|
|
if (k2 === undefined) k2 = k;
|
|
|
|
|
o[k2] = m[k];
|
|
|
|
|
@@ -8598,7 +8639,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
@@ -8630,9 +8671,9 @@ class Pattern {
|
|
|
|
|
else {
|
|
|
|
|
// Convert to pattern
|
|
|
|
|
segments = segments || [];
|
|
|
|
|
assert_1.default(segments.length, `Parameter 'segments' must not empty`);
|
|
|
|
|
(0, assert_1.default)(segments.length, `Parameter 'segments' must not empty`);
|
|
|
|
|
const root = Pattern.getLiteral(segments[0]);
|
|
|
|
|
assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
|
|
|
|
|
(0, assert_1.default)(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);
|
|
|
|
|
pattern = new internal_path_1.Path(segments).toString().trim();
|
|
|
|
|
if (patternOrNegate) {
|
|
|
|
|
pattern = `!${pattern}`;
|
|
|
|
|
@@ -8726,13 +8767,13 @@ class Pattern {
|
|
|
|
|
*/
|
|
|
|
|
static fixupPattern(pattern, homedir) {
|
|
|
|
|
// Empty
|
|
|
|
|
assert_1.default(pattern, 'pattern cannot be empty');
|
|
|
|
|
(0, assert_1.default)(pattern, 'pattern cannot be empty');
|
|
|
|
|
// Must not contain `.` segment, unless first segment
|
|
|
|
|
// Must not contain `..` segment
|
|
|
|
|
const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));
|
|
|
|
|
assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
|
|
|
|
|
(0, assert_1.default)(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);
|
|
|
|
|
// Must not contain globs in root, e.g. Windows UNC path \\foo\b*r
|
|
|
|
|
assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
|
|
|
|
|
(0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);
|
|
|
|
|
// Normalize slashes
|
|
|
|
|
pattern = pathHelper.normalizeSeparators(pattern);
|
|
|
|
|
// Replace leading `.` segment
|
|
|
|
|
@@ -8742,8 +8783,8 @@ class Pattern {
|
|
|
|
|
// Replace leading `~` segment
|
|
|
|
|
else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {
|
|
|
|
|
homedir = homedir || os.homedir();
|
|
|
|
|
assert_1.default(homedir, 'Unable to determine HOME directory');
|
|
|
|
|
assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
|
|
|
|
|
(0, assert_1.default)(homedir, 'Unable to determine HOME directory');
|
|
|
|
|
(0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);
|
|
|
|
|
pattern = Pattern.globEscape(homedir) + pattern.substr(1);
|
|
|
|
|
}
|
|
|
|
|
// Replace relative drive root, e.g. pattern is C: or C:foo
|
|
|
|
|
@@ -93023,7 +93064,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
exports.restoreCache = void 0;
|
|
|
|
|
exports.setWindowsCacheDirectories = exports.restoreCache = void 0;
|
|
|
|
|
const cache = __importStar(__nccwpck_require__(7799));
|
|
|
|
|
const core = __importStar(__nccwpck_require__(2186));
|
|
|
|
|
const glob = __importStar(__nccwpck_require__(8090));
|
|
|
|
|
@@ -93031,6 +93072,7 @@ const path_1 = __importDefault(__nccwpck_require__(1017));
|
|
|
|
|
const fs_1 = __importDefault(__nccwpck_require__(7147));
|
|
|
|
|
const constants_1 = __nccwpck_require__(9042);
|
|
|
|
|
const cache_utils_1 = __nccwpck_require__(1678);
|
|
|
|
|
const os_1 = __importDefault(__nccwpck_require__(2037));
|
|
|
|
|
const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
|
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
|
|
|
|
const platform = process.env.RUNNER_OS;
|
|
|
|
|
@@ -93058,6 +93100,41 @@ const restoreCache = (versionSpec, packageManager, cacheDependencyPath) => __awa
|
|
|
|
|
core.info(`Cache restored from key: ${cacheKey}`);
|
|
|
|
|
});
|
|
|
|
|
exports.restoreCache = restoreCache;
|
|
|
|
|
const setWindowsCacheDirectories = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
|
|
if (os_1.default.platform() !== 'win32')
|
|
|
|
|
return;
|
|
|
|
|
let goCache = yield (0, cache_utils_1.getCommandOutput)(`go env GOCACHE`);
|
|
|
|
|
core.info(`GOCACHE: ${goCache}`);
|
|
|
|
|
goCache = goCache.replace('C:', 'D:').replace('c:', 'd:');
|
|
|
|
|
if (!fs_1.default.existsSync(goCache)) {
|
|
|
|
|
core.info(`${goCache} does not exist. Creating`);
|
|
|
|
|
fs_1.default.mkdirSync(goCache, { recursive: true });
|
|
|
|
|
}
|
|
|
|
|
const setOutput = yield (0, cache_utils_1.getCommandOutput)(`go env -w GOCACHE=${goCache}`);
|
|
|
|
|
core.info(`go env -w GOCACHE output: ${setOutput}`);
|
|
|
|
|
let goModCache = yield (0, cache_utils_1.getCommandOutput)(`go env GOMODCACHE`);
|
|
|
|
|
core.info(`GOMODCACHE: ${goModCache}`);
|
|
|
|
|
goModCache = goModCache.replace('C:', 'D:').replace('c:', 'd:');
|
|
|
|
|
if (!fs_1.default.existsSync(goModCache)) {
|
|
|
|
|
core.info(`${goModCache} does not exist. Creating`);
|
|
|
|
|
fs_1.default.mkdirSync(goModCache, { recursive: true });
|
|
|
|
|
}
|
|
|
|
|
const setModOutput = yield (0, cache_utils_1.getCommandOutput)(`go env -w GOMODCACHE=${goModCache}`);
|
|
|
|
|
core.info(`go env -w GOMODCACHE output: ${setModOutput}`);
|
|
|
|
|
let goTmpDir = yield (0, cache_utils_1.getCommandOutput)(`go env GOTMPDIR`);
|
|
|
|
|
core.info(`GOTMPDIR: ${goTmpDir}`);
|
|
|
|
|
if (!goTmpDir || goTmpDir === '') {
|
|
|
|
|
goTmpDir = 'D:\\gotmp';
|
|
|
|
|
}
|
|
|
|
|
goTmpDir = goTmpDir.replace('C:', 'D:').replace('c:', 'd:');
|
|
|
|
|
if (!fs_1.default.existsSync(goTmpDir)) {
|
|
|
|
|
core.info(`${goTmpDir} does not exist. Creating`);
|
|
|
|
|
fs_1.default.mkdirSync(goTmpDir, { recursive: true });
|
|
|
|
|
}
|
|
|
|
|
const setGoTmpOutput = yield (0, cache_utils_1.getCommandOutput)(`go env -w GOTMPDIR=${goTmpDir}`);
|
|
|
|
|
core.info(`go env -w GOTMPDIR output: ${setGoTmpOutput}`);
|
|
|
|
|
});
|
|
|
|
|
exports.setWindowsCacheDirectories = setWindowsCacheDirectories;
|
|
|
|
|
const findDependencyFile = (packageManager) => {
|
|
|
|
|
const dependencyFile = packageManager.dependencyFilePattern;
|
|
|
|
|
const workspace = process.env.GITHUB_WORKSPACE;
|
|
|
|
|
@@ -93669,6 +93746,7 @@ const os_1 = __importDefault(__nccwpck_require__(2037));
|
|
|
|
|
function run() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
try {
|
|
|
|
|
yield (0, cache_restore_1.setWindowsCacheDirectories)();
|
|
|
|
|
//
|
|
|
|
|
// versionSpec is optional. If supplied, install / use from the tool cache
|
|
|
|
|
// If not supplied then problem matchers will still be setup. Useful for self-hosted.
|
|
|
|
|
|