Cadey is coffee
<Cadey> Hello! Thank you for visiting my website. You seem to be using an ad-blocker. I understand why you do this, but I'd really appreciate if it you would turn it off for my website. These ads help pay for running the website and are done by Ethical Ads. I do not receive detailed analytics on the ads and from what I understand neither does Ethical Ads. If you don't want to disable your ad blocker, please consider donating on Patreon or sending some extra cash to xeiaso.eth or 0xeA223Ca8968Ca59e0Bc79Ba331c2F6f636A3fB82. It helps fund the website's hosting bills and pay for the expensive technical editor that I use for my longer articles. Thanks and be well!

Why is GitHub Actions installing Go 1.2 when I specify Go 1.20?

Read time in minutes: 1

hero image hime
Image generated by Ligne Claire -- masterpiece, 1girl, green hair, ligne claire, sunset, depth of field, black, yellow, blue, orange, haze

Because YAML parsing is horrible. YAML supports floating point numbers and the following floating point numbers are identical:

  - 1.2
  - 1.20

To get this working correctly, you need to quote the version number:

- name: Set up Go
  uses: actions/setup-go@v4
    go-version: "1.20"

This will get you Go version 1.20.x, not Go version 1.2.x.

Cadey is coffee
<Cadey> I hate YAML.

Worse, this problem will only show up about once every 5 years, so I'm going to add a few blatant SEO farming sentences here:

  • Why is GitHub Actions installing Go 1.3 when I specify Go 1.30?
  • Why is GitHub Actions installing Go 1.4 when I specify Go 1.40?
  • Why is GitHub Actions installing Go 1.5 when I specify Go 1.50?
  • Why is GitHub Actions installing Go 1.6 when I specify Go 1.60?
  • Why is GitHub Actions installing Go 1.7 when I specify Go 1.70?
  • Why is the GitHub Actions AI reconstructing my entire program in Go 1.8 instead of Go 1.80 like I told it to?
  • Why is Go 2.0 not out yet?
  • .i mu'i ma loi proga cu se mabla?
  • Why has everything gone to hell after they discovered that weird rock in Kenya?
  • Why is GitHub Actions installing Python 3.1 when I specify Python 3.10?

Quote your version numbers.

This article was posted on M05 05 2023. Facts and circumstances may have changed since publication. Please contact me before jumping to conclusions if something seems wrong or unclear.

Tags: go yaml

This post was not WebMentioned yet. You could be the first!

The art for Mara was drawn by Selicre.

The art for Cadey was drawn by ArtZora Studios.

Some of the art for Aoi was drawn by @Sandra_Thomas01.