-
Notifications
You must be signed in to change notification settings - Fork 61k
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
Incorrect return type for startsWith
?
#19416
Comments
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines. |
@Saransh-cpp Thanks so much for opening an issue! I'll triage this for the team to take a look 👀 |
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀 |
Hi! The actions editor treats YAML expressions as if they were strings. Unfortunately we can't parse them yet, which is why you get the error. In any case, your expression should return a boolean when committed and running. Hope this helps 🙂 |
Thanks for the clarification, @thyeggman! Because there's no docs change required, I'll close this issue. |
Thanks for the help, @thyeggman, and @lucascosti! Would it be possible to highlight this behavior of the GH editor somewhere in the docs? Or is it already highlighted, but I missed it? (Due to the misleading warning, I ended up removing this line from all of my user-facing projects and all of the open-source projects I maintain.) |
🤔 Hmmm, we don't tend to document bug-like behavior in the docs, and this would be tough to mention in the right spots because the issue is rather with the option being set (in this case @thyeggman Do you have any thoughts? Is it possible to update the editor to exclude that warning for options that expect a non-string result when provided with an expression? |
Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/expressions
What part(s) of the article would you like to see updated?
The docs for
startsWith
states that it returns aboolean
value - https://docs.github.com/en/actions/learn-github-actions/expressions#startswith, but I get an error saying that the returned value is astring
(attached below).I am unsure if the behavior has been updated and the docs are stale, if I am doing something wrong, or if this is a bug. Could someone please help me out with this?
Additional information
The error in
GitHub Actions
editor -The text was updated successfully, but these errors were encountered: