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 .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
--head ${{ steps.create_branch.outputs.branch_name }} \
--title "Release ${{ steps.new_version.outputs.new_tag }}" \
--body "Automated release PR for ${{ steps.new_version.outputs.new_tag }}" \
--reviewer mousamdahal || echo "PR creation failed, possibly no changes or reviewer issue"
--reviewer sarosejoshi || echo "PR creation failed, possibly no changes or reviewer issue"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
3 changes: 3 additions & 0 deletions cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type RootDependencies struct {
RDSService rds.RDSServiceInterface
EKSService eks.EKSServiceInterface
ECRService ecr.ECRServiceInterface
Version string
}

func NewRootCmd(deps RootDependencies) *cobra.Command {
Expand All @@ -37,7 +38,9 @@ func NewRootCmd(deps RootDependencies) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
Version: deps.Version,
}
rootCmd.SetVersionTemplate(`{{printf "%s version %s\n" .Name .Version}}`)

rootCmd.AddCommand(cmdSSO.NewSSOCommands(cmdSSO.SSODependencies{
SetupClient: deps.SSOSetupClient,
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"github.com/aws/aws-sdk-go-v2/service/ssm"
)

var Version = "0.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

@sanjog-lama Never hardcode versions in source code, Use semantic versioning (major.minor.patch)

I recommend auto version bumping based on commit messages

Few tools will help you

  • go-releaser
  • semantic-release

Copy link
Contributor Author

@sanjog-lama sanjog-lama Jun 25, 2025

Choose a reason for hiding this comment

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

@sarosejoshi sir, I have added that hardcoded version just for testing purpose. That version gets overwritten during build. I have used go-releaser and sematic-release versioning. The code can be found on workflows/releaser.yaml file.
So, should I replace the version with something like dev?


func main() {

ssoSetupClient, err := sso.NewSSOClient(sso.NewPrompter(), &common.RealCommandExecutor{})
Expand Down Expand Up @@ -95,6 +97,7 @@ func main() {
RDSService: rdsSvc,
EKSService: eksSvc,
ECRService: ecrSvc,
Version: Version,
})
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
Expand Down
Loading