crossplane-contrib / crossplane-contrib/provider-workflows

Go version from go.mod file - extra maintenance and possible version drift, user error

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Makefile
Stars
2
Forks
11
PR merge metrics
No merged PRs in 30d

Description

In a consumer of this workflow there are three places to update the Go version:

* `go.mod` - ensures local development uses the right version - https://github.com/crossplane-contrib/provider-kubernetes/blob/main/go.mod#L3
* `ci` - https://github.com/crossplane-contrib/provider-kubernetes/blob/main/.github/workflows/ci.yml#L13 (not using the reusable workflow in this case, but if it did it would still need the version)
* `publish` - the version used when building a release. It's _also_ a manual input. https://github.com/crossplane-contrib/provider-kubernetes/blob/main/.github/workflows/publish-provider-package.yaml#L10-L12

I propose moving to `go-version-file` instead as the default, and removing the input from the publish workflow in provider-kubernetes.

```yaml
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
```

https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file

This will ensure there's a single place to update the version, and that they all operate on the same version number.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the referenced go.mod, .github/workflows/ci.yml, and .github/workflows/publish-provider-package.yaml files, then compare how each currently receives the Go version. Update the workflow configuration so the version comes from go.mod and remove the publish workflow's manual version input. Done means local, CI, and release builds use one version source.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, go
Domain
ci-cd, release
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.