Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
fetch-depth: 0

- name: 'Codeowners Plus'
uses: multimediallc/codeowners-plus@v1.3.0
uses: multimediallc/codeowners-plus@v1.3.1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While updating the example to use the new version tag is correct, there's a significant underlying issue with how this action is versioned. The action.yml file currently points to the latest Docker image: image: 'docker://ghcr.io/multimediallc/codeowners-plus:latest'.

This means that regardless of the version specified in the uses clause (e.g., @v1.3.1), users will always execute the code from the latest Docker image. This defeats the purpose of version pinning and can lead to unexpected pipeline failures if breaking changes are introduced.

To fix this, the release process should be updated to:

  1. Build and push a version-specific Docker image (e.g., ghcr.io/multimediallc/codeowners-plus:v1.3.1).
  2. Update the action.yml in the corresponding git tag to point to that versioned Docker image.

This is a crucial fix for providing a stable and reliable action for your users. Since action.yml is not part of this PR, this should be addressed in a follow-up.

with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
pr: '${{ github.event.pull_request.number }}'
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func main() {
app := &cli.App{
Name: "codeowners-cli",
Usage: "CLI tool for working with .codeowners files",
Version: "v1.3.1.dev",
Version: "v1.3.2.dev",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the version string requires manual updates and is prone to errors. A more robust practice is to inject the version at build time using ldflags.

To implement this, you can define a package-level variable and use it here. Then, set its value during the build process.

  1. Define a version variable at the package level in this file:

    var version = "dev" // Default for development builds
  2. Update your build command to inject the version string:

    go build -ldflags="-X 'main.version=v1.3.2'"

This will make your release process more automated and less error-prone.

Suggested change
Version: "v1.3.2.dev",
Version: version,

Description: "",
Commands: []*cli.Command{
{
Expand Down
Loading