4 ms·
I believe !foo is part of the YAML spec. It's how you define custom tags (contains in this case). But it's super confusing because ! usually means NOT in any p
by nickjj 6y ago
I believe !foo is part of the YAML spec. It's how you define custom tags (contains in this case).
But it's super confusing because ! usually means NOT in any programming context so you would mentally parse that as the message NOT containing "wip" when in reality, the opposite is what happens. CloudFormation does this too and they have "If" defined as a custom function so you end up with !If which is super confusing for a condition where you expect "if condition is true do this else that".
- derefr 6y agoYAML tags precede their value-terms. For a string value, the !tag syntax occurs before the opening quotation mark/heredoc marker of the string. It’s like a Java annotation. This isn’t a YAML tag; it’s just YAML embedding some opaque text from some random command-language that uses exclamation marks to mean something. In fact, actually considering the meaning of the action, the ! used here probably is just the regular ol’ boolean NOT operator in most languages: the action has specified that it should trigger only for commits that aren’t tagged as WIPs. (Which is an eminently-sensible condition to provide.)
- nickjj 6y agoGood catch, yeah I think you're right about how it's currently implemented with GH actions. Which makes things even more confusing overall since ! is a thing in YAML when it's not wrapped in quotes. Suddenly you have all of these tools implementing their idea of custom behavior in different ways.