mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Update @actions/glob to 0.3.0
This commit is contained in:
17
dist/index.js
vendored
17
dist/index.js
vendored
@@ -2833,14 +2833,14 @@ exports.create = create;
|
|||||||
* @param patterns Patterns separated by newlines
|
* @param patterns Patterns separated by newlines
|
||||||
* @param options Glob options
|
* @param options Glob options
|
||||||
*/
|
*/
|
||||||
function hashFiles(patterns, options) {
|
function hashFiles(patterns, options, verbose = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let followSymbolicLinks = true;
|
let followSymbolicLinks = true;
|
||||||
if (options && typeof options.followSymbolicLinks === 'boolean') {
|
if (options && typeof options.followSymbolicLinks === 'boolean') {
|
||||||
followSymbolicLinks = options.followSymbolicLinks;
|
followSymbolicLinks = options.followSymbolicLinks;
|
||||||
}
|
}
|
||||||
const globber = yield create(patterns, { followSymbolicLinks });
|
const globber = yield create(patterns, { followSymbolicLinks });
|
||||||
return internal_hash_files_1.hashFiles(globber);
|
return internal_hash_files_1.hashFiles(globber, verbose);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.hashFiles = hashFiles;
|
exports.hashFiles = hashFiles;
|
||||||
@@ -7571,10 +7571,11 @@ const fs = __importStar(__webpack_require__(747));
|
|||||||
const stream = __importStar(__webpack_require__(413));
|
const stream = __importStar(__webpack_require__(413));
|
||||||
const util = __importStar(__webpack_require__(669));
|
const util = __importStar(__webpack_require__(669));
|
||||||
const path = __importStar(__webpack_require__(622));
|
const path = __importStar(__webpack_require__(622));
|
||||||
function hashFiles(globber) {
|
function hashFiles(globber, verbose = false) {
|
||||||
var e_1, _a;
|
var e_1, _a;
|
||||||
var _b;
|
var _b;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
const writeDelegate = verbose ? core.info : core.debug;
|
||||||
let hasMatch = false;
|
let hasMatch = false;
|
||||||
const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd();
|
const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd();
|
||||||
const result = crypto.createHash('sha256');
|
const result = crypto.createHash('sha256');
|
||||||
@@ -7582,13 +7583,13 @@ function hashFiles(globber) {
|
|||||||
try {
|
try {
|
||||||
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
|
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
|
||||||
const file = _d.value;
|
const file = _d.value;
|
||||||
core.debug(file);
|
writeDelegate(file);
|
||||||
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
|
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
|
||||||
core.debug(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
|
writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fs.statSync(file).isDirectory()) {
|
if (fs.statSync(file).isDirectory()) {
|
||||||
core.debug(`Skip directory '${file}'.`);
|
writeDelegate(`Skip directory '${file}'.`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const hash = crypto.createHash('sha256');
|
const hash = crypto.createHash('sha256');
|
||||||
@@ -7610,11 +7611,11 @@ function hashFiles(globber) {
|
|||||||
}
|
}
|
||||||
result.end();
|
result.end();
|
||||||
if (hasMatch) {
|
if (hasMatch) {
|
||||||
core.debug(`Found ${count} files to hash.`);
|
writeDelegate(`Found ${count} files to hash.`);
|
||||||
return result.digest('hex');
|
return result.digest('hex');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.debug(`No matches found for glob`);
|
writeDelegate(`No matches found for glob`);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -12,7 +12,7 @@
|
|||||||
"@actions/core": "^1.8.1",
|
"@actions/core": "^1.8.1",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@actions/glob": "^0.2.0",
|
"@actions/glob": "^0.3.0",
|
||||||
"@actions/io": "^1.1.1",
|
"@actions/io": "^1.1.1",
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||||
@@ -66,9 +66,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/glob": {
|
"node_modules/@actions/glob": {
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
||||||
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==",
|
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
@@ -6212,9 +6212,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/glob": {
|
"@actions/glob": {
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.3.0.tgz",
|
||||||
"integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==",
|
"integrity": "sha512-tJP1ZhF87fd6LBnaXWlahkyvdgvsLl7WnreW1EZaC8JWjpMXmzqWzQVe/IEYslrkT9ymibVrKyJN4UMD7uQM2w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
"minimatch": "^3.0.4"
|
"minimatch": "^3.0.4"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"@actions/core": "^1.8.1",
|
"@actions/core": "^1.8.1",
|
||||||
"@actions/exec": "^1.1.0",
|
"@actions/exec": "^1.1.0",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@actions/glob": "^0.2.0",
|
"@actions/glob": "^0.3.0",
|
||||||
"@actions/io": "^1.1.1",
|
"@actions/io": "^1.1.1",
|
||||||
"@octokit/core": "^3.5.1",
|
"@octokit/core": "^3.5.1",
|
||||||
"@octokit/plugin-paginate-rest": "^2.17.0",
|
"@octokit/plugin-paginate-rest": "^2.17.0",
|
||||||
@@ -54,4 +54,4 @@
|
|||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user