Allow to set a token from input (#1)
Reviewed-on: #1 Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Co-committed-by: Julien Fastré <julien.fastre@champs-libres.coop>
This commit is contained in:
5
main.go
5
main.go
@@ -69,8 +69,9 @@ func main() {
|
||||
githubactions.Fatalf("could not get context: %v", err.Error())
|
||||
}
|
||||
|
||||
token := os.Getenv("GITHUB_TOKEN")
|
||||
token := githubactions.GetInput("token")
|
||||
fmt.Printf("Api url is %v\n", ctx.ServerURL)
|
||||
fmt.Printf("Debug: token length is %d characters\n", len(token))
|
||||
|
||||
config, err := ParseActionConfig(*ctx)
|
||||
if err != nil {
|
||||
@@ -125,7 +126,7 @@ func (a *Agent) ExistingOpenPullRequest(config CreatePrConfig) (bool, *gitea.Pul
|
||||
gitea.ListPullRequestsOptions{State: gitea.StateOpen, ListOptions: gitea.ListOptions{Page: currentPage}})
|
||||
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
return false, nil, fmt.Errorf("error while listing all exisiting open pull requests: %v", err.Error())
|
||||
}
|
||||
|
||||
for _, pull := range pulls {
|
||||
|
Reference in New Issue
Block a user