From 62fd71c1b9404a4445d04ac1185a94ba9bf6eef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 8 Mar 2024 12:13:40 +0100 Subject: [PATCH] Fix the way the environment variables are retrieved --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 3cce7f0..71f447b 100644 --- a/main.go +++ b/main.go @@ -19,8 +19,9 @@ func ParseActionConfig(ctx githubactions.GitHubContext) (*CreatePrConfig, error) rawRepo := strings.Split(githubactions.GetInput("GITHUB_REPOSITORY"), "/") if len(rawRepo) != 2 { - return nil, fmt.Errorf("incorrect number of string from string: %v, %d", githubactions.GetInput("GITHUB_REPOSITORY"), len(rawRepo)) + return nil, fmt.Errorf("incorrect number of string from string: %v, %d", os.Getenv("GITHUB_REPOSITORY"), len(rawRepo)) } + repo := rawRepo[1] title := githubactions.GetInput("title") if title == "" { @@ -54,7 +55,7 @@ func ParseActionConfig(ctx githubactions.GitHubContext) (*CreatePrConfig, error) return &CreatePrConfig{ Org: ctx.RepositoryOwner, - Repo: rawRepo[1], + Repo: repo, HeadBranch: head, BaseBranch: base, Title: title,