From 791d9eedcc376f8cc4c69c8c30a203440fa7feba Mon Sep 17 00:00:00 2001 From: Josh Komoroske Date: Fri, 9 Feb 2024 20:53:08 -0500 Subject: [PATCH] fix: correct environment variable references --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a6b0818..6dd7587 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ package main import ( "fmt" "os" + "strings" "github.com/joshdk/actions-docker-shim/docker" flag "github.com/spf13/pflag" @@ -28,14 +29,16 @@ func mainCmd() error { flag.Parse() if image == "" { - image = fmt.Sprintf("ghcr.io/%s:%s", os.Getenv("GITHUB_REPOSITORY"), os.Getenv("GITHUB_ACTION_REF")) + repository := os.Getenv("GITHUB_ACTION_REPOSITORY") + ref := os.Getenv("GITHUB_ACTION_REF") + image = fmt.Sprintf("ghcr.io/%s:%s", strings.ToLower(repository), ref) } var token string if value := os.Getenv("GITHUB_TOKEN"); value != "" { // Environment variable named "GITHUB_TOKEN". token = value - } else if value := os.Getenv("INPUT_GITHUB_TOKEN"); value != "" { + } else if value := os.Getenv("INPUT_GITHUB-TOKEN"); value != "" { // Input named "github-token". token = value } else if value := os.Getenv("INPUT_TOKEN"); value != "" {