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

SUP-2264-2: Correct 'unbound variable' on array expansion #19

Merged
merged 3 commits into from
Jun 7, 2024

Conversation

tomowatt
Copy link

@tomowatt tomowatt commented May 30, 2024

Misunderstanding by myself on how ${!args[@]} works and missed when locally testing the parameter expansion when there are values in the array in #15

Updated to not substitute args if it is null/empty therefore not producing an empty string, else expand args to give the expect Wiz CLI Parameters. See docs for details:

${parameter:+word}

If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted. 

https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

Adding a section to gather all the Wiz CLI parameters under for when new ones are added.

@tomowatt tomowatt marked this pull request as draft May 30, 2024 13:33
@tomowatt tomowatt marked this pull request as ready for review May 30, 2024 14:58
@tomowatt
Copy link
Author

Tests ran to checking when Parameters are set and not set.

steps:
  - label: "Scan Terraform Files in Directory - with IAC Type"
    command: "cd test-terraform && ls"
    plugins:
      - wiz#SUP-2264-2:
          scan-type: 'iac'
          iac-type: 'Terraform'
          path: 'test-terraform'
  
  - label: "Scan Terraform Files in Directory - without IAC Type"
    command: "cd test-terraform && ls"
    plugins:
      - wiz#SUP-2264-2:
          scan-type: 'iac'
          path: 'test-terraform'

Copy link

@jeremybumsted jeremybumsted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this @tomowatt. I think this is good, but need to update some things to make the linter happy in the build 😄

@tomowatt
Copy link
Author

@jeremybumsted rebased my branch now so linter is now happy, but double checking before merging testing worked all good on your side?

@jeremybumsted
Copy link

jeremybumsted commented Jun 6, 2024

@jeremybumsted rebased my branch now so linter is now happy, but double checking before merging testing worked all good on your side?

@tomowatt Yes - everything looks good from my end too, go ahead and merge!

@tomowatt tomowatt merged commit 83912fa into main Jun 7, 2024
1 check passed
@tomowatt tomowatt deleted the SUP-2264-2 branch June 7, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants