Skip to content
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

Merged
merged 5 commits into from
Mar 29, 2019
Merged

Conversation

richardlt
Copy link
Member

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

@richardlt richardlt force-pushed the feat-git-hash-short branch from f8120cf to 7d0bda4 Compare March 28, 2019 13:22
@@ -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]
Copy link
Member

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'

Copy link
Member

@yesnault yesnault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yesnault yesnault merged commit 2369134 into master Mar 29, 2019
@richardlt richardlt deleted the feat-git-hash-short branch April 4, 2019 08:03
@fsamin fsamin added the ascode bugs, features concerning as code format label Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ascode bugs, features concerning as code format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants