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

tg_command Fails to Recognize Multi-Level Folder Paths with Wildcards #80

Open
guicrocetti opened this issue Nov 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@guicrocetti
Copy link

*Describe the Bug
The tg_command function does not interpret multi-level folder paths with wildcards correctly. For example, running the following command in the terminal works as expected:

terragrunt run-all plan --terragrunt-working-dir my-folder/*/*-test

In this case, terragrunt successfully plans all content within folders ending in "-test".

However, attempting to run the same command with tg_command results in an error indicating the folder path cannot be found:

tg_command: 'run-all plan --terragrunt-working-dir ${{ vars.PROJECT_ID }}/*/*-${{ env.git_environment }}'

Error received:

ERROR  lstat my-folder/*/*-test: no such file or directory

Interestingly, removing the wildcard syntax resolves the issue, as shown below:

tg_command: 'run-all plan --terragrunt-working-dir ${{ vars.PROJECT_ID }}/folder-name/folder-prefix-${{ env.git_environment }}'

This simplified version also works without error:

tg_command: 'run-all plan --terragrunt-working-dir ${{ vars.PROJECT_ID }}'

However, using a partial wildcard pattern like the example below still triggers a "folder not found" error:

tg_command: 'run-all plan --terragrunt-working-dir ${{ vars.PROJECT_ID }}/folder-name/*-${{ env.git_environment }}'

Suggestion:
The issue might stem from tg_command interpreting * as a literal folder name, rather than as a wildcard.

Expected Behavior
The tg_command should recognize and correctly handle folder paths with multi-level wildcard patterns, similar to the behavior of the terragrunt command in the terminal.

Terragrunt Action Version: V2
Environment Details:

  • tg_version: "0.67.16"
  • tf_version: "1.9.7"
@guicrocetti guicrocetti added the bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant