Skip to content

Commit

Permalink
Update @actions/glob license version
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmgross committed Oct 11, 2022
1 parent c09747e commit ca24d5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .licenses/npm/@actions/glob.dep.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 8 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2915,14 +2915,14 @@ exports.create = create;
* @param patterns Patterns separated by newlines
* @param options Glob options
*/
function hashFiles(patterns, options, verbose = false) {
function hashFiles(patterns, options) {
return __awaiter(this, void 0, void 0, function* () {
let followSymbolicLinks = true;
if (options && typeof options.followSymbolicLinks === 'boolean') {
followSymbolicLinks = options.followSymbolicLinks;
}
const globber = yield create(patterns, { followSymbolicLinks });
return internal_hash_files_1.hashFiles(globber, verbose);
return internal_hash_files_1.hashFiles(globber);
});
}
exports.hashFiles = hashFiles;
Expand Down Expand Up @@ -9095,25 +9095,24 @@ const fs = __importStar(__webpack_require__(747));
const stream = __importStar(__webpack_require__(413));
const util = __importStar(__webpack_require__(669));
const path = __importStar(__webpack_require__(622));
function hashFiles(globber, verbose = false) {
function hashFiles(globber) {
var e_1, _a;
var _b;
return __awaiter(this, void 0, void 0, function* () {
const writeDelegate = verbose ? core.info : core.debug;
let hasMatch = false;
const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : 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;
writeDelegate(file);
core.debug(file);
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
core.debug(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
continue;
}
if (fs.statSync(file).isDirectory()) {
writeDelegate(`Skip directory '${file}'.`);
core.debug(`Skip directory '${file}'.`);
continue;
}
const hash = crypto.createHash('sha256');
Expand All @@ -9135,11 +9134,11 @@ function hashFiles(globber, verbose = false) {
}
result.end();
if (hasMatch) {
writeDelegate(`Found ${count} files to hash.`);
core.debug(`Found ${count} files to hash.`);
return result.digest('hex');
}
else {
writeDelegate(`No matches found for glob`);
core.debug(`No matches found for glob`);
return '';
}
});
Expand Down

0 comments on commit ca24d5f

Please sign in to comment.