webhook: add run creation trigger type
This commit is contained in:
parent
1938c2daaf
commit
5b22ebc2d3
|
@ -50,6 +50,8 @@ const (
|
||||||
AnnotationProjectID = "projectid"
|
AnnotationProjectID = "projectid"
|
||||||
AnnotationUserID = "userid"
|
AnnotationUserID = "userid"
|
||||||
|
|
||||||
|
AnnotationRunCreationTrigger = "run_creation_trigger"
|
||||||
|
|
||||||
AnnotationCommitSHA = "commit_sha"
|
AnnotationCommitSHA = "commit_sha"
|
||||||
AnnotationRef = "ref"
|
AnnotationRef = "ref"
|
||||||
AnnotationSender = "sender"
|
AnnotationSender = "sender"
|
||||||
|
@ -264,6 +266,7 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) (int, string, error) {
|
||||||
annotations := map[string]string{
|
annotations := map[string]string{
|
||||||
AnnotationRunType: string(runType),
|
AnnotationRunType: string(runType),
|
||||||
AnnotationRefType: string(refType),
|
AnnotationRefType: string(refType),
|
||||||
|
AnnotationRunCreationTrigger: string(types.RunCreationTriggerTypeWebhook),
|
||||||
AnnotationCommitSHA: webhookData.CommitSHA,
|
AnnotationCommitSHA: webhookData.CommitSHA,
|
||||||
AnnotationRef: webhookData.Ref,
|
AnnotationRef: webhookData.Ref,
|
||||||
AnnotationSender: webhookData.Sender,
|
AnnotationSender: webhookData.Sender,
|
||||||
|
|
|
@ -28,3 +28,9 @@ const (
|
||||||
RunRefTypeTag RunRefType = "tag"
|
RunRefTypeTag RunRefType = "tag"
|
||||||
RunRefTypePullRequest RunRefType = "pull_request"
|
RunRefTypePullRequest RunRefType = "pull_request"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type RunCreationTriggerType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
RunCreationTriggerTypeWebhook RunCreationTriggerType = "webhook"
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue