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: mode all ignore empty path error #329

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fr12k
Copy link

@fr12k fr12k commented Mar 4, 2024

We want to use this Github action to run terraform for all modules within one Github repository except in certain folders.

- uses: fr12k/terraform-monorepo-action@master
  id: all-stacks
  with:
    mode: all
    ignore: organization/**/*

The setup from above always resulted in the following error no matter what was configured in the ignore block.

path must not be empty

It looks like the found terraform modules list contains invalid or empty paths

modules = await getAllModules(token, monitored)

This cause the used ignore library to throw the error path must not be empty.

https://github.com/kaelzhang/node-ignore/blob/49bd7fa2f1be34ed3e78995d4f6a92fa0b5033d2/index.js#L399

Solution

Remove any null, not defined or empty paths from the modules list.

In mode all there is an error when the path is empty.
Before apply the ignore filter remove any invalid or empty paths.
@fr12k fr12k requested a review from a team as a code owner March 4, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant