-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Unable to interpolate string - hyphenated variables #104
Comments
i was afraid of this :( Implementing the expression logic in Any ideas on how to fix? |
From the blogpost I've just read [1] and the releases history, you actually used a parser released by github. Unfortunately actions/workflow-parser is dead. Can you tell me what happened ? [1] https://github.blog/2019-02-07-an-open-source-parser-for-github-actions/ |
The first cut of actions was completely different from the GA version. Seems like it was a rewrite to be based on Azure DevOps. |
You're right, it was based on HashiCorp HCL. Now GA uses yaml syntax. |
The problem here isn't the parsing of the workflow files. I am using yaml parser for those (and previously the lib for HCL from github). However, some of the values in the yaml have a custom GitHub expression: https://help.github.com/en/actions/reference/contexts-and-expression-syntax-for-github-actions That expression is what needs an evaluator, and what I use Otto for |
Hey guys, I'm having the same problem here :( As @mced pointed out,for a workaround to this, you can switch all variables with The problem is when you have another action that implement output variables, for example: actions/cache When I check for the Great work in this package btw. |
Hey guys. Looking further into the GA expression docs, there are two ways of writing an expression.
Since GA runner accepts it, otto evaluates it correctly, and we can run it both with |
@cplee I found another case where this is an issue and the workaround doesn't work;
which gives the error:
|
Confirmed @torbjornvatn :( I'm really stumped on this one. I'd really rather not have to implement my own parser for GitHub Actions expression language. Open to suggestions. |
@cplee Replace the dot notation with the array notation before evaluate the expression is an option? |
ya, that may work @icarcal ...would be a rather interesting regex |
While I agree it would be somewhat annoying to port it to Golang, the expression parser for it is at least open source. You can find the lexer here, for example. It really doesn't look too bad. |
Great find @eventualbuddha - would love some help with this one! |
Dug a little more at that lexer, looks like the right regex for the actual token would be something like I'll try and do a PR in the next couple of days. |
#286 is quite interesting Here is the code handling the evaluation of the if-expression at high-level : Lines 254 to 266 in 7cc6687
With this setup, we have This is not properly parsed by So we end up with Lines 259 to 261 in 7cc6687
So here But if we change just a little bit the if-expression with : - if: steps.bincache.outputs.cache-hit != 'true'
+ if: ${{ steps.bincache.outputs.cache-hit != 'true' }} Then Lines 65 to 67 in 7cc6687
So here, we end up with Lines 262 to 263 in 7cc6687
In particular, we got this debug log line :
And But the reason is different from the previous case, and the fix will likely be sightly different. |
I'm facing an issue when I'm trying to reference a
steps.<id>.outputs.<variable>
with an id composed with-
.Workaround; remove all
-
in id names.The text was updated successfully, but these errors were encountered: