统一gitee commit sha 环境变量

This commit is contained in:
yashin 2020-06-02 18:50:20 +08:00
parent c49b1b02b9
commit 01dd2f5ee4
4 changed files with 11 additions and 1 deletions

View File

@ -150,6 +150,9 @@ public final class CauseData {
variables.put("giteeTargetRepoHttpUrl", targetRepoHttpUrl);
variables.put("giteeBefore", before);
variables.put("giteeAfter", after);
variables.put("giteeBeforeCommitSha", before);
variables.put("giteeAfterCommitSha", after);
variables.put("giteeRef", ref);
variables.put("ref", ref);
variables.put("beforeSha", beforeSha);
variables.put("isTag", isTag);

View File

@ -114,6 +114,9 @@ class NoteHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<NoteHook>
.withTargetRepoHttpUrl(hook.getPullRequest().getTarget().getGitHttpUrl())
.withTriggeredByUser(hook.getPullRequest().getHead().getUser().getName())
.withLastCommit(hook.getPullRequest().getMergeCommitSha())
.withSha(hook.getPullRequest().getMergeCommitSha())
.withAfter(hook.getPullRequest().getMergeCommitSha())
.withRef(hook.getPullRequest().getTargetBranch())
.withTargetProjectUrl(hook.getPullRequest().getTarget().getUrl())
.withTriggerPhrase(hook.getComment().getBody())
.withPathWithNamespace(hook.getPullRequest().getBase().getRepo().getPathWithNamespace())
@ -130,7 +133,7 @@ class NoteHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<NoteHook>
return buildStatusUpdate()
.withProjectId(hook.getPullRequest().getSourceProjectId())
.withSha(hook.getPullRequest().getMergeCommitSha())
.withRef(hook.getPullRequest().getSourceBranch())
.withRef(hook.getPullRequest().getTargetBranch())
.build();
}

View File

@ -179,6 +179,9 @@ class PullRequestHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<Pu
.withTargetRepoHttpUrl(hook.getPullRequest().getTarget().getGitHttpUrl())
.withTriggeredByUser(hook.getPullRequest().getHead().getUser().getName())
.withLastCommit(hook.getPullRequest().getMergeCommitSha())
.withSha(hook.getPullRequest().getMergeCommitSha())
.withAfter(hook.getPullRequest().getMergeCommitSha())
.withRef(hook.getPullRequest().getTargetBranch())
.withTargetProjectUrl(hook.getPullRequest().getTarget().getUrl())
.withPathWithNamespace(hook.getRepo().getPathWithNamespace())
.build();

View File

@ -96,6 +96,7 @@ class PushHookTriggerHandlerImpl extends AbstractWebHookTriggerHandler<PushHook>
.withAfter(hook.getAfter())
.withRef(hook.getRef())
.withLastCommit(hook.getAfter())
.withSha(hook.getAfter())
.withCreated(hook.getCreated())
.withDeleted(hook.getDeleted())
.withTargetProjectUrl(hook.getProject().getUrl())