-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): add git hash short variable auto #4119
Conversation
f8120cf
to
7d0bda4
Compare
engine/hooks/poller.go
Outdated
@@ -17,6 +17,7 @@ func fillPayload(pushEvent sdk.VCSPushEvent) map[string]string { | |||
payload["git.author"] = pushEvent.Commit.Author.Name | |||
payload["git.author.email"] = pushEvent.Commit.Author.Email | |||
payload["git.branch"] = strings.TrimPrefix(strings.TrimPrefix(pushEvent.Branch.DisplayID, "refs/heads/"), "refs/tags/") | |||
payload["git.hash.short"] = pushEvent.Commit.Hash[:7] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length have to check to avoid a potential 'runtime error: slice bounds out of range'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://ovh.github.io/cds/docs/concepts/variables/ should be updated
@ovh/cds