Skip to content
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

Closed
1 task done
Saransh-cpp opened this issue Jul 30, 2022 · 7 comments
Closed
1 task done

Incorrect return type for startsWith? #19416

Saransh-cpp opened this issue Jul 30, 2022 · 7 comments
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team needs SME This proposal needs review from a subject matter expert waiting for review Issue/PR is waiting for a writer's review

Comments

@Saransh-cpp
Copy link

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 a boolean value - https://docs.github.com/en/actions/learn-github-actions/expressions#startswith, but I get an error saying that the returned value is a string (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 -

image

@Saransh-cpp Saransh-cpp added the content This issue or pull request belongs to the Docs Content team label Jul 30, 2022
@welcome
Copy link

welcome bot commented Jul 30, 2022

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.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jul 30, 2022
@cmwilson21
Copy link
Contributor

@Saransh-cpp Thanks so much for opening an issue! I'll triage this for the team to take a look 👀

@cmwilson21 cmwilson21 added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team labels Aug 1, 2022
@lucascosti lucascosti added the needs SME This proposal needs review from a subject matter expert label Aug 22, 2022
@github-actions
Copy link
Contributor

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀

@thyeggman
Copy link
Contributor

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 🙂

@lucascosti
Copy link
Contributor

Thanks for the clarification, @thyeggman!

Because there's no docs change required, I'll close this issue.

@lucascosti lucascosti closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2022
@Saransh-cpp
Copy link
Author

Saransh-cpp commented Aug 23, 2022

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.)

@lucascosti
Copy link
Contributor

Would it be possible to highlight this behavior of the GH editor somewhere in the docs?

🤔 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 cancel-in-progress) rather than the behavior of the expression (which we have many that return a Boolean result).

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team needs SME This proposal needs review from a subject matter expert waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

No branches or pull requests

5 participants
@lucascosti @thyeggman @Saransh-cpp @cmwilson21 and others