Skip to content

Commit

Permalink
feat: use fast-glob instead of globby (#285)
Browse files Browse the repository at this point in the history
We have been using an outdated version of globby because the new version is not compatible. This poses as risk as we are no longer receiving security updates.
  • Loading branch information
sethvargo committed Jun 21, 2022
1 parent d8dc20b commit c68f13b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
12 changes: 6 additions & 6 deletions dist/index.js

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
"@actions/core": "^1.9.0",
"@google-cloud/storage": "^6.1.0",
"@google-github-actions/actions-utils": "^0.4.0",
"globby": "^11.0.4",
"fast-glob": "^3.2.1",
"ignore": "^5.2.0"
},
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions src/util.ts
Expand Up @@ -18,7 +18,7 @@ import { promises as fs } from 'fs';
import * as path from 'path';
import * as v8 from 'v8';

import globby from 'globby';
import fg from 'fast-glob';
import { toPlatformPath, toPosixPath } from '@google-github-actions/actions-utils';

/**
Expand Down Expand Up @@ -97,8 +97,10 @@ export function parseBucketNameAndPrefix(name: string): [bucket: string, prefix:
*/
export async function expandGlob(directoryPath: string, glob: string): Promise<string[]> {
const directoryPosix = toPosixPath(directoryPath);
const pth = toPosixPath(path.posix.join(directoryPosix, glob));
const filesList = await globby([pth], {
const search = toPosixPath(glob || '**/*');
const filesList = await fg(search, {
absolute: true,
cwd: directoryPath,
dot: true,
});

Expand Down

0 comments on commit c68f13b

Please sign in to comment.