{"id":18353972,"url":"https://github.com/arnested/go-version-action","last_synced_at":"2026-03-14T10:05:10.825Z","repository":{"id":38196214,"uuid":"340771641","full_name":"arnested/go-version-action","owner":"arnested","description":"A GitHub action for using the latest released Go version and the minimal support Go version (from go.mod) and a build matrix of them and all versions in between.","archived":false,"fork":false,"pushed_at":"2025-04-01T11:57:16.000Z","size":4764,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T12:37:27.361Z","etag":null,"topics":["ci","github-actions","go","go-modules","golang","hacktoberfest","versions"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/go-version-action","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arnested.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-20T22:59:47.000Z","updated_at":"2025-04-01T11:57:20.000Z","dependencies_parsed_at":"2023-10-10T21:26:12.553Z","dependency_job_id":"e20d2da5-4bd3-4f98-a8d5-29fa66411d3f","html_url":"https://github.com/arnested/go-version-action","commit_stats":{"total_commits":544,"total_committers":5,"mean_commits":108.8,"dds":"0.30514705882352944","last_synced_commit":"f5239293d2037ce66225941953a21f50f7cac76b"},"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnested%2Fgo-version-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnested%2Fgo-version-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnested%2Fgo-version-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnested%2Fgo-version-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arnested","download_url":"https://codeload.github.com/arnested/go-version-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247484305,"owners_count":20946384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","github-actions","go","go-modules","golang","hacktoberfest","versions"],"created_at":"2024-11-05T21:43:37.526Z","updated_at":"2026-03-14T10:05:10.811Z","avatar_url":"https://github.com/arnested.png","language":"JavaScript","readme":"# Go version action\n\nA GitHub action for using the latest released Go version and your\nprojects minimal support Go version (from go.mod), and a build matrix\nof them, and all versions in between.\n\n## Motive\n\nBeing consistent is hard.\n\nI used to hard-code the Go versions my projects needed for test and\nbuilds in my GitHub Actions workflow files.\n\nOf course, the result was that I used different versions in the\n`go.mod` file and my workflow files.\n\nWhenever a new version of Go was released, I forgot to add the new\nversion to my build matrix and my projects weren't tested on the new\nrelease(s).\n\nSo, I build this action.\n\nThe action reads the minimal supported Go version from your `go.mod`\nfile and exposes it as a variable to your workflow.\n\nIt also pulls the list of release tags from\n[https://go.dev/dl/](https://go.dev/dl/) and exposes the latest\nreleased Go version as a variable as well.\n\nFrom the list of released Go versions and the minimal version, your\nmodule supports we also build a \"matrix\" variable to be used as a\nbuild matrix.\n\nWhile we are at it, we also extract the module path from the `go.mod`\nfile, even though it hasn't really anything to do with versions ;)\n\n## Inputs\n\nIf your `go mod` file is located in a non-standard location, you can\nspecify the working directory where it is located:\n\n```yaml\nworking-directory:\n  description: Working directory where your go.mod file is located\n  required: false\n  default: .\nunstable:\n  description: Include unstable versions of Go (beta, release candidates)\n  required: false\n  default: 'false'\nunsupported:\n  description: Include unsupported versions of Go\n  required: false\n  default: 'true'\npatch-level:\n  description: Include the patch levels on the versions (default is major.minor)\n  required: false\n  default: 'false'\nlatest-patches-only:\n  description: When patch-level is true, only include the latest patch version of each major.minor version in the matrix. Does nothing if patch-level is false. Cannot be used with unstable.\n  required: false\n  default: 'false'\nstrict-semver:\n  default: Use strict semver version. E.g. `1.16` -\u003e `1.16.0` and `1.18beta2` -\u003e `1.18.0-beta.2`.\n  required: false\n  default: 'false'\n```\n\n## Outputs\n\n```yaml\ngo-mod-version:\n  description: The Go version specified by go.mod\nlatest:\n  description: The latest Go version\nminimal:\n  description: The minimal Go version\nmatrix:\n  description: A (stringified) array of Go versions from the minimal supported version to the latest released version\nmodule:\n  description: The Go module path (as specified by go.mod)\n```\n\n## Examples\n\nLet's say your `go.mod` specifies Go 1.13 as the minimal supported\nversion and you want your workflow to set up Go version 1.13 using the\n[actions/setup-go](https://github.com/actions/setup-go) action:\n\n```yaml\nname: My Go workflow\non: pull_request\n\njobs:\n  my-go-workflow:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: arnested/go-version-action@v2\n        id: go-version\n      - name: Install Go ${{ steps.go-version.outputs.minimal }}\n        uses: actions/setup-go@v3\n        with:\n          go-version: ${{ steps.go-version.outputs.minimal }}\n          check-latest: true\n```\n\n![Log of running action](docs/action-run.png)\n\nIf you want do a matrix test of all Go versions from your minimally\nsupported version up to the latest released version we need to do a\nbit more.\n\nWe have to run the version lookup as a separate job and let the test\njob depend on it:\n\n```yaml\non: push\nname: Test\n\njobs:\n  go-versions:\n    name: Lookup Go versions\n    runs-on: ubuntu-latest\n    outputs:\n      matrix: ${{ steps.versions.outputs.matrix }}\n    steps:\n      - uses: actions/checkout@v3\n      - uses: arnested/go-version-action@v2\n        id: versions\n  test:\n    name: Test\n    runs-on: ubuntu-latest\n    needs: go-versions\n    strategy:\n      matrix:\n        version: ${{ fromJSON(needs.go-versions.outputs.matrix) }}\n    steps:\n      - uses: actions/checkout@v3\n      - name: Install Go\n        uses: actions/setup-go@v3\n        with:\n          go-version: ${{ matrix.version }}\n          check-latest: true\n      - name: Go test\n        run: go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt ./...\n```\n\n![The workflow summary](docs/action-matrix-summary.png)\n\n## Summary\n\nThe action writes a [GitHub Actions Job\nSummary](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/)\nwith values it identified.\n\nThis example is from running with:\n\n```yaml\n          unsupported: false\n          patch-level: true\n```\n\n![Job summary](docs/job-summary.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnested%2Fgo-version-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnested%2Fgo-version-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnested%2Fgo-version-action/lists"}