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

fix: return path before yaml or tpl to get changed module #109

Merged
merged 11 commits into from
Feb 1, 2022
8 changes: 4 additions & 4 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ export function getModulePaths<T extends Record<string, unknown>>(
): string[] {
const result = files?.reduce<string[]>((paths, file) => {
const { dir, base, ext } = parse(file[pathProp] as string)
if (
ext === '.tf' ||
base === '.terraform.lock.hcl' ||
ext === '.yaml' ||
ext === '.tpl'
) {
if (ext === '.tf' || base === '.terraform.lock.hcl') {
paths.push(dir)
} else if (ext.match(/ya?ml/) !== null || ext === '.tpl') {
paths.push(dir.split('/').at(-2)!)
}
return paths
}, [])
Expand Down