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 was merged in pull request #1.
This commit is contained in:
1 parent
8f676ccb15
commit
3e47a24f8d
3 files changed
+38
-3
No files matched your search
@@ -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