Skip to content

Commit

Permalink
chore: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdk committed Feb 9, 2024
1 parent 2c43c39 commit 2b8d25d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build
on:
pull_request:
push:
branches:
- "master"

jobs:
build:
Expand Down
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,25 @@ func main() {

//nolint:forbidigo,wsl
func mainCmd() error {
fmt.Printf("::group::%s\n", "Debug")
for _, env := range os.Environ() {
fmt.Println(env)
}
fmt.Println("::endgroup::")

var image string
flag.StringVar(&image, "image", "", "ghcr.io image to run")
flag.Parse()

if image == "" {
image = fmt.Sprintf("ghcr.io/%s:%s", os.Getenv("GITHUB_REPOSITORY"), os.Getenv("GITHUB_ACTION_REF"))
image = fmt.Sprintf("ghcr.io/%s:%s", os.Getenv("GITHUB_ACTION_REPOSITORY"), os.Getenv("GITHUB_ACTION_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 != "" {
Expand Down

0 comments on commit 2b8d25d

Please sign in to comment.