Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update @actions/glob to 0.3.0 #279

Merged
merged 4 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 9 additions & 8 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) {
function hashFiles(patterns, options, verbose = false) {
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);
return internal_hash_files_1.hashFiles(globber, verbose);
});
}
exports.hashFiles = hashFiles;
Expand Down Expand Up @@ -9095,24 +9095,25 @@ 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) {
function hashFiles(globber, verbose = false) {
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;
core.debug(file);
writeDelegate(file);
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;
}
if (fs.statSync(file).isDirectory()) {
core.debug(`Skip directory '${file}'.`);
writeDelegate(`Skip directory '${file}'.`);
continue;
}
const hash = crypto.createHash('sha256');
Expand All @@ -9134,11 +9135,11 @@ function hashFiles(globber) {
}
result.end();
if (hasMatch) {
core.debug(`Found ${count} files to hash.`);
writeDelegate(`Found ${count} files to hash.`);
return result.digest('hex');
}
else {
core.debug(`No matches found for glob`);
writeDelegate(`No matches found for glob`);
return '';
}
});
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.0",
"@actions/github": "^5.0.0",
"@actions/glob": "^0.2.0",
"@actions/glob": "^0.3.0",
"@actions/io": "^1.1.1",
"@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.17.0",
Expand All @@ -55,4 +55,4 @@
"ts-jest": "^27.0.5",
"typescript": "^4.3.5"
}
}
}