Skip to content

Commit cc807a9

Browse files
committed
V4
1 parent 9f44ffa commit cc807a9

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

dist/index.js

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

+31
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,43 @@ export async function run(): Promise<void> {
2222
?.split(',')
2323
.map(directory => directory.trim())
2424

25+
// Clean out any empty strings
26+
if (components) {
27+
components.filter(Boolean)
28+
}
29+
30+
if (componentSearchDirectories) {
31+
componentSearchDirectories.filter(Boolean)
32+
}
33+
2534
if (!components || components.length === 0) {
2635
core.setFailed('No components provided to search for.')
2736

2837
return
2938
}
3039

40+
// Make sure component search directories are resolved to the absolute path of the repository
41+
const repositoryPath = process.env.GITHUB_WORKSPACE
42+
43+
if (repositoryPath === undefined) {
44+
core.setFailed('No repository path found.')
45+
46+
return
47+
}
48+
49+
if (componentSearchDirectories.length > 0) {
50+
for (let i = 0; i < componentSearchDirectories.length; i++) {
51+
const searchDir = componentSearchDirectories[i]
52+
53+
if (!path.isAbsolute(searchDir)) {
54+
componentSearchDirectories[i] = path.resolve(
55+
repositoryPath,
56+
searchDir
57+
)
58+
}
59+
}
60+
}
61+
3162
const prettyDirectories =
3263
componentSearchDirectories.length === 0
3364
? 'all directories'

0 commit comments

Comments
 (0)