Skip to content

Commit 4e571f7

Browse files
committed
Get the first found file path or null if not found
Regenerated dist/index.js
1 parent 49f1ec6 commit 4e571f7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/search.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ function searchBuildinfo() {
1111
function searchFilePath(fileName) {
1212
const searchPath = `**/${fileName}`;
1313
core.info(`Search for file in ${searchPath}!`);
14-
return globSync(searchPath);
14+
const filePaths = globSync(searchPath);
15+
// Return the first found file path or null if not found
16+
return filePaths.length > 0 ? filePaths[0] : null;
1517
}
1618

1719
module.exports = {

0 commit comments

Comments
 (0)