enable custom build parameters when creating a build
This commit is contained in:
parent
8ed432e851
commit
ed89046557
1 changed files with 13 additions and 1 deletions
|
@ -84,7 +84,19 @@ func HandleCreate(
|
||||||
AuthorEmail: commit.Author.Email,
|
AuthorEmail: commit.Author.Email,
|
||||||
AuthorAvatar: commit.Author.Avatar,
|
AuthorAvatar: commit.Author.Avatar,
|
||||||
Sender: user.Login,
|
Sender: user.Login,
|
||||||
Params: map[string]string{}, // todo: popular from query parameters
|
Params: map[string]string{},
|
||||||
|
}
|
||||||
|
|
||||||
|
for key, value := range r.URL.Query() {
|
||||||
|
if key == "access_token" ||
|
||||||
|
key == "commit" ||
|
||||||
|
key == "branch" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(value) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
hook.Params[key] = value[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := triggerer.Trigger(r.Context(), repo, hook)
|
result, err := triggerer.Trigger(r.Context(), repo, hook)
|
||||||
|
|
Loading…
Reference in a new issue