@@ -2915,14 +2915,14 @@ exports.create = create;
2915
2915
* @param patterns Patterns separated by newlines
2916
2916
* @param options Glob options
2917
2917
*/
2918
- function hashFiles(patterns, options) {
2918
+ function hashFiles(patterns, options, verbose = false ) {
2919
2919
return __awaiter(this, void 0, void 0, function* () {
2920
2920
let followSymbolicLinks = true;
2921
2921
if (options && typeof options.followSymbolicLinks === 'boolean') {
2922
2922
followSymbolicLinks = options.followSymbolicLinks;
2923
2923
}
2924
2924
const globber = yield create(patterns, { followSymbolicLinks });
2925
- return internal_hash_files_1.hashFiles(globber);
2925
+ return internal_hash_files_1.hashFiles(globber, verbose );
2926
2926
});
2927
2927
}
2928
2928
exports.hashFiles = hashFiles;
@@ -9095,24 +9095,25 @@ const fs = __importStar(__webpack_require__(747));
9095
9095
const stream = __importStar(__webpack_require__(413));
9096
9096
const util = __importStar(__webpack_require__(669));
9097
9097
const path = __importStar(__webpack_require__(622));
9098
- function hashFiles(globber) {
9098
+ function hashFiles(globber, verbose = false ) {
9099
9099
var e_1, _a;
9100
9100
var _b;
9101
9101
return __awaiter(this, void 0, void 0, function* () {
9102
+ const writeDelegate = verbose ? core.info : core.debug;
9102
9103
let hasMatch = false;
9103
9104
const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd();
9104
9105
const result = crypto.createHash('sha256');
9105
9106
let count = 0;
9106
9107
try {
9107
9108
for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {
9108
9109
const file = _d.value;
9109
- core.debug (file);
9110
+ writeDelegate (file);
9110
9111
if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {
9111
- core.debug (`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
9112
+ writeDelegate (`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);
9112
9113
continue;
9113
9114
}
9114
9115
if (fs.statSync(file).isDirectory()) {
9115
- core.debug (`Skip directory '${file}'.`);
9116
+ writeDelegate (`Skip directory '${file}'.`);
9116
9117
continue;
9117
9118
}
9118
9119
const hash = crypto.createHash('sha256');
@@ -9134,11 +9135,11 @@ function hashFiles(globber) {
9134
9135
}
9135
9136
result.end();
9136
9137
if (hasMatch) {
9137
- core.debug (`Found ${count} files to hash.`);
9138
+ writeDelegate (`Found ${count} files to hash.`);
9138
9139
return result.digest('hex');
9139
9140
}
9140
9141
else {
9141
- core.debug (`No matches found for glob`);
9142
+ writeDelegate (`No matches found for glob`);
9142
9143
return '';
9143
9144
}
9144
9145
});
0 commit comments