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

Unquoted optional variable reference generates invalid bash #19

Closed
christhekeele opened this issue Jul 7, 2023 · 4 comments · Fixed by #42
Closed

Unquoted optional variable reference generates invalid bash #19

christhekeele opened this issue Jul 7, 2023 · 4 comments · Fixed by #42

Comments

@christhekeele
Copy link

On this line:

if [[ "${{ inputs.deployment-name }}" != false && ${{ inputs.deployment-id }} != false ]]; then

The ${{ inputs.deployment-id }} term is unquoted. As it is meant to be optional, that meant that the bash expression expands (post-GH-action variable interpolation) into:

if [[ "false" != false &&  != false ]]; then

This is invalid syntax and fails with

/home/runner/work/_temp/04f0abde-f9c5-44e7-ba1b-7e59ee4a4c3b.sh: line 10: conditional binary operator expected
@Geoffrey-Schuette-Simpli-Fi

Running into this error/issue as well. Looks like @christhekeele nailed the issues and the suggested fix.

I don't see anything in your ReadMe for a process to contribute to the repo, but I am sure there are plenty of devs that would be happy to open a PR for a hotfix around this. I would be happy to.

My org has built a process that is a shell of this repo to deploy our processes in CI/CD, but I would like to start moving to something like this. This is the second time we have tried.

@christhekeele
Copy link
Author

@Geoffrey-Schuette-Simpli-Fi

FWIW if you need to you can just switch over to always providing a deployment-id to avoid this rather than deployment-name

@christhekeele
Copy link
Author

I have created a fork that tries to fix this, but I don't have the means to vigorously test all input permutations, so more people trying it out is better: main...christhekeele:astro-deploy-action:add-missing-quoting-to-inputs

@Geoffrey-Schuette-Simpli-Fi

Thank you for the tip @christhekeele . I tried the id and was still getting the same error. I changed it back to our original process for now. I don't want to keep other team members from deploying anything right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants