Skip to content

Commit adf30a3

Browse files
HinterwaeldlersMartin Guethle
andauthored
Readded the commit count value (#241)
Co-authored-by: Martin Guethle <[email protected]>
1 parent 7101b1c commit adf30a3

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ GITLAB_REPO_HOMEPAGE
550550
GITLAB_REPO_GIT_SSH_URL
551551
GITLAB_REPO_GIT_HTTP_URL
552552
GITLAB_REPO_VISIBILITY_LEVEL
553+
GITLAB_COMMIT_COUNT
553554
GITLAB_REQUEST_URL
554555
GITLAB_REQUEST_STRING
555556
GITLAB_REQUEST_TOKEN

src/main/java/io/jenkins/plugins/gitlabbranchsource/Cause/GitLabPushCauseData.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.kohsuke.stapler.export.Exported;
77
import org.kohsuke.stapler.export.ExportedBean;
88

9+
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultIntString;
910
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultLongString;
1011
import static io.jenkins.plugins.gitlabbranchsource.Cause.GitLabCauseUtils.defaultVisibilityString;
1112
import static org.apache.commons.lang.StringUtils.defaultString;
@@ -48,6 +49,7 @@ public GitLabPushCauseData(PushEvent pushEvent) {
4849
this.variables.put("GITLAB_REPO_GIT_SSH_URL", defaultString(pushEvent.getRepository().getGit_ssh_url()));
4950
this.variables.put("GITLAB_REPO_GIT_HTTP_URL", defaultString(pushEvent.getRepository().getGit_http_url()));
5051
this.variables.put("GITLAB_REPO_VISIBILITY_LEVEL", defaultVisibilityString(pushEvent.getRepository().getVisibility_level()));
52+
this.variables.put("GITLAB_COMMIT_COUNT", defaultIntString(pushEvent.getTotalCommitsCount()));
5153
this.variables.put("GITLAB_REQUEST_URL", defaultString(pushEvent.getRequestUrl()));
5254
this.variables.put("GITLAB_REQUEST_STRING", defaultString(pushEvent.getRequestQueryString()));
5355
this.variables.put("GITLAB_REQUEST_TOKEN", defaultString(pushEvent.getRequestSecretToken()));

0 commit comments

Comments
 (0)