-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Why does 'on' have single quotes in the ci.yml? #441
-
Why does 'on' have single quotes in the ci.yml?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Good question! With YAML, there are a number of boolean aliases besides just true and false, like True/False, Yes/No, and on/off.
So depending on your interpreter, an on could be interpreted as a 1 or boolean True, and GitHub Actions should most definitely only identify it as on meaning "on these specific conditions".
I think it's a little annoying they used a potentially boolean operator for a root level key, but with or without quotes, it should work at least inside GitHub Actions. But I like to write a little closer to spec, and so I specify definitively, to any and all YAML parsers, that on is indeed, a string key ('on'), and not a boolean (which a poorly written parser could justifiably interpret).
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1