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

Quote language versions in YAML examples #14764

Closed
1 of 6 tasks
skedwards88 opened this issue Jan 28, 2022 · 8 comments · Fixed by #16167 or #28936
Closed
1 of 6 tasks

Quote language versions in YAML examples #14764

skedwards88 opened this issue Jan 28, 2022 · 8 comments · Fixed by #16167 or #28936
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 help wanted Anyone is welcome to open a pull request to fix this issue pumpkin-spice Specifically tracked Hacktoberfest issue - internal purposes

Comments

@skedwards88
Copy link
Contributor

skedwards88 commented Jan 28, 2022

Code of Conduct

What article on docs.github.com is affected?

YAML examples in https://docs.github.com/actions

What part(s) of the article would you like to see updated?

YAML treats floats like 2.10 as 2.1. This can lead to workflows using a different language version than intended. We should update the YAML examples to quote language versions to avoid this. To help users who copy-paste-modify without understanding the nuance, we should quote all language versions, even ones that would not be affected by this parsing.

For example:

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9]

should be changed to

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.6", "3.7", "3.8", "3.9"]

Then if a user copies the example but wants to include version 3.10, they can easily plug in the new value without knowing they need to add quotes.

Additional information

No response

Actions articles with examples that need quotes

@skedwards88 skedwards88 added help wanted Anyone is welcome to open a pull request to fix this issue content This issue or pull request belongs to the Docs Content team actions This issue or pull request should be reviewed by the docs actions team labels Jan 28, 2022
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Jan 28, 2022
@bee-Michi
Copy link

Hi! Where can i find the code to edit, so i can send a pr?

@bee-Michi
Copy link

Or if there's no code to edit and I'm stupid, please let me know!

@Moloko122

This comment has been minimized.

@ramyaparimi ramyaparimi removed the triage Do not begin working on this issue until triaged by the team label Jan 31, 2022
@skedwards88
Copy link
Contributor Author

Reopening this since some but not all examples have been addressed. Others are welcome to open PRs to partially address this issue as well!

@skedwards88 skedwards88 reopened this Mar 11, 2022
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 11, 2022
@ramyaparimi ramyaparimi removed the triage Do not begin working on this issue until triaged by the team label Mar 14, 2022
@cmwilson21 cmwilson21 added the pumpkin-spice Specifically tracked Hacktoberfest issue - internal purposes label Sep 30, 2022
@Elvira888

This comment was marked as spam.

@Elvira888

This comment was marked as spam.

@Elvira888

This comment was marked as spam.

@felicitymay
Copy link
Contributor

I looked for articles that hadn't yet been fixed and added them to the issue summary.

muzimuzhi added a commit to muzimuzhi/action.js that referenced this issue Dec 21, 2023
kfcampbell added a commit to octokit/action.js that referenced this issue Jan 5, 2024
* docs(readme): update actions used in example

* docs(readme): quote node version in example

see github/docs#14764

* Update README.md

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
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 help wanted Anyone is welcome to open a pull request to fix this issue pumpkin-spice Specifically tracked Hacktoberfest issue - internal purposes
Projects
None yet
9 participants
@felicitymay @skedwards88 @ramyaparimi @cmwilson21 @bee-Michi @Moloko122 @Elvira888 and others