Skip to content

Quote language versions in YAML examples #14764

Description

@skedwards88

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issuepumpkin-spiceSpecifically tracked Hacktoberfest issue - internal purposes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions