Fix the way the repository is retrieved

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

View File

@ -17,11 +17,8 @@ func ParseActionConfig(ctx githubactions.GitHubContext) (*CreatePrConfig, error)
return nil, errors.New("base branch name cannot be empty")
}
rawRepo := strings.Split(githubactions.GetInput("GITHUB_REPOSITORY"), "/")
if len(rawRepo) != 2 {
return nil, fmt.Errorf("incorrect number of string from string: %v, %d", os.Getenv("GITHUB_REPOSITORY"), len(rawRepo))
}
repo := rawRepo[1]
repo := ctx.Repository
fmt.Printf("The repository is %v\n", repo)
title := githubactions.GetInput("title")
if title == "" {