Skip to content

Commit

Permalink
make sure pipelinerun is set on incoming webhooks
Browse files Browse the repository at this point in the history
maybe we will do target-event incoming in the future but today is not
the day (and not documented)

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
  • Loading branch information
chmouel committed Jun 2, 2022
1 parent fc728e9 commit af33d84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/content/docs/guide/incoming_webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ after setting this up, you will be able to trigger a PipelineRun called
`https://github.com/owner/repo`. As an example here is the full curl snippet:

```shell
curl -X POST https://control.pac.url/incoming?secret=very-secure-secret&repository=repo,branch=main
curl -X POST https://control.pac.url/incoming?secret=very-secure-secret&repository=repo,branch=main&pipelinerun=target_pipelinerun
```

note two things the `"/incoming"` path to the controller URL and the `"POST"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/adapter/incoming.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func (l *listener) detectIncoming(ctx context.Context, req *http.Request, payloa
if req.URL.Path != "/incoming" {
return false, nil, nil
}
if repository == "" || querySecret == "" || branch == "" {
return false, nil, fmt.Errorf("missing query URL argument: branch, repository, secret: %+v",
if pipelineRun == "" || repository == "" || querySecret == "" || branch == "" {
return false, nil, fmt.Errorf("missing query URL argument: pipelinerun, branch, repository, secret: %+v",
req.URL.Query())
}

Expand Down

0 comments on commit af33d84

Please sign in to comment.