Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit22d9f76

Browse files
author
chhsia0
committed
Set secret token inCreateHook only if non-empty.
1 parentfdc0060 commit22d9f76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎scm/driver/gitlab/repo.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ func (s *repositoryService) ListStatus(ctx context.Context, repo, ref string, op
114114
func (s*repositoryService)CreateHook(ctx context.Context,repostring,input*scm.HookInput) (*scm.Hook,*scm.Response,error) {
115115
params:= url.Values{}
116116
params.Set("url",input.Target)
117-
params.Set("token",input.Secret)
117+
// Earlier versions of gitlab returned an error if the token was an empty string, so we only set
118+
// the token value if non-empty.
119+
ifinput.Secret!="" {
120+
params.Set("token",input.Secret)
121+
}
118122
params.Set("enable_ssl_verification",strconv.FormatBool(!input.SkipVerify))
119123
fork,v:=rangeconvertFromHookEvents(input.Events) {
120124
params.Set(k,strconv.FormatBool(v))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp