Problem with YAML syntax #25495
-
Hello everyone! I am writing my workflow file on YAML but it says there is an error on line 4
Can anybody tell me what is wrong with my syntax? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hey @lpzhang5, can you share the full YAML file? Either inline or a link to your repository. It would make it easier for us to assist you. The reason I want some more context is that the code you have shared is not YAML, it’s a Bash script. The problem you are facing might be related to how you are embedding the Bash script in the YAML file, but without more context, I can only guess. |
Beta Was this translation helpful? Give feedback.
-
Hello @thomasjo , The full YAML file is here there is some bash script embedded for setting env vars, it says there is problem at the line for ‘elif’ github.comlpzhang5/CI-Workflow/blob/abbdda05cac4326dd757a0de6ad0095f98b81be5/.github/workflows/deploy.yml
|
Beta Was this translation helpful? Give feedback.
-
Thanks for that. The problem is caused by missing indentation in the multiline block for the Bash script. Add indentation to the entire Bash script block and your problem should be resolved.
|
Beta Was this translation helpful? Give feedback.
-
Thank you! It is fixed now. Quite a few headaches due to this minor but subtle problem! |
Beta Was this translation helpful? Give feedback.
Thanks for that. The problem is caused by missing indentation in the multiline block for the Bash script. Add indentation to the entire Bash script block and your problem should be resolved.