Fix the way the environment variables are retrieved

This commit is contained in:
Julien Fastré 2024-03-08 12:13:40 +01:00
parent deb1ba6843
commit 62fd71c1b9
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
1 changed files with 3 additions and 2 deletions

View File

@ -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,