Skip to content

Commit

Permalink
feat: flag to specify github token username
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdk committed Feb 10, 2024
1 parent dd353f5 commit 04a1171
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ func mainCmd() error {
var image string
flag.StringVar(&image, "image", "", "ghcr.io image to run")
var tokenEnv string
flag.StringVar(&tokenEnv, "token-env", "", "env var to use for ghcr.io token")
flag.StringVar(&tokenEnv, "token-env", "", "env var to use for github token")
var username string
flag.StringVar(&username, "username", os.Getenv("GITHUB_ACTOR"), "username for github token")
flag.Parse()

if image == "" {
Expand All @@ -52,7 +54,7 @@ func mainCmd() error {
}

fmt.Printf("::group::%s\n", "Docker login")
err := docker.Login(os.Getenv("GITHUB_ACTOR"), token)
err := docker.Login(username, token)
fmt.Println("::endgroup::")
if err != nil {
return err
Expand Down

0 comments on commit 04a1171

Please sign in to comment.