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

var is referenced but not assigned for env variables #45

Open
johnbieren opened this issue Jul 15, 2024 · 2 comments
Open

var is referenced but not assigned for env variables #45

johnbieren opened this issue Jul 15, 2024 · 2 comments

Comments

@johnbieren
Copy link

The shellchecker reports var is referenced but not assigned. when you define something in the tekton step env. For example, this

      env:
        - name: gwCert
           valueFrom:
            secretKeyRef:
              name: $(params.gwSecret)
              key: cert

results in shellchecker reporting

SC2154
gwCert is referenced but not assigned.
@chmeliik
Copy link
Owner

Would using UPPER_CASE variable naming work for you? That's the shellcheck convention for variables coming from outside the script itself.

Lowercase external variables will be reported as undefined unless you assert otherwise (e.g. with a declare statement or a # shellcheck: disable <error-code>)

@johnbieren
Copy link
Author

Ah, I did not know that. Just confirmed, using uppercase naming leads to shellchecker no longer reporting an issue. That is sufficient for me - I will leave it up to you if you want to leave this open for supporting it even if not uppercase or just close it

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

No branches or pull requests

2 participants