push

package
v0.0.0-...-4d838b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(r *http.Request, body []byte) ([]byte, error)

Handler is an InterceptionFunc that checks that the GitHub request body matches the requested fields.

It recognises the following request headers:

X-GitHub-Event - this is provided by GitHub in its hook-mechanism
Push-Ref - this is configured on the trigger interceptor
PushExclude-Ref - this is configured on the trigger interceptor
Push-Repo - this is the full name of the GitHub repo e.g.
tektoncd/triggers.

If a Push-Repo is provided, and no Push-Ref, then this will match on _all_ pushes from the Repo.

If a Push-Repo is provided, and no Push-Ref, but a PushExclude-Ref is provided, then the interceptor will match only if the hook's ref does not match the excluded ref.

If the request matches the configuration, the body is returned, with an additional key added to the body: "intercepted.ref" which will be the shortened version of the ref extracting just the last part (the branch).

func MatchPushAction

func MatchPushAction(r *http.Request, event *github.PushEvent) (bool, error)

MatchPushAction will match on push notifications, if the ref for the commit matches the branch provided in the pushRefHeader and the Push-Repo matches the repository.full_name in the body.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL