Skip to content
21 changes: 12 additions & 9 deletions lib/glob-assets.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { basename, resolve } from "node:path";

import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
import dirGlob from "dir-glob";
import { globby } from "globby";
import debugFactory from "debug";
import dirGlob from "dir-glob";
import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
import { glob as tg } from "tinyglobby";

const debug = debugFactory("semantic-release:github");

Expand All @@ -27,12 +27,15 @@ export default async function globAssets({ cwd }, assets) {
return [];
}

const globbed = await globby(glob, {
cwd,
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
Copy link
Author

@pralkarz pralkarz Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue doesn't happen with tinyglobby, so we don't need to disable expanding directories.

dot: true,
onlyFiles: false,
});
const globbed = (
await tg(glob, {
cwd,
dot: true,
onlyFiles: false,
})
).map((result) =>
result.endsWith("/") ? result.slice(0, -1) : result,
);

if (isPlainObject(asset)) {
if (globbed.length > 1) {
Expand Down
57 changes: 55 additions & 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"aggregate-error": "^5.0.0",
"debug": "^4.3.4",
"dir-glob": "^3.0.1",
"globby": "^14.0.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.0",
"issue-parser": "^7.0.0",
"lodash-es": "^4.17.21",
"mime": "^4.0.0",
"p-filter": "^4.0.0",
"tinyglobby": "^0.2.12",
"url-join": "^5.0.0"
},
"devDependencies": {
Expand Down