feat: adding workflow_dispatch webhook event

This commit is contained in:
Callum
2021-10-09 10:07:07 +01:00
parent 8657a34f32
commit d36d47fe66
4 changed files with 67 additions and 3 deletions

View File

@@ -69,9 +69,10 @@ type ScaleUpTrigger struct {
}
type GitHubEventScaleUpTriggerSpec struct {
CheckRun *CheckRunSpec `json:"checkRun,omitempty"`
PullRequest *PullRequestSpec `json:"pullRequest,omitempty"`
Push *PushSpec `json:"push,omitempty"`
CheckRun *CheckRunSpec `json:"checkRun,omitempty"`
PullRequest *PullRequestSpec `json:"pullRequest,omitempty"`
Push *PushSpec `json:"push,omitempty"`
WorkflowDispatch *WorkflowDispatchSpec `json:"push,omitempty"`
}
// https://docs.github.com/en/actions/reference/events-that-trigger-workflows#check_run
@@ -101,6 +102,13 @@ type PullRequestSpec struct {
type PushSpec struct {
}
// WorkflowDispatchSpec is the condition for triggering scale-up on push event
// Also see https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
type WorkflowDispatchSpec struct {
Branches []string `json:"branches,omitempty"`
BranchesIgnore []string `json:"branchesIgnore,omitempty"`
}
// CapacityReservation specifies the number of replicas temporarily added
// to the scale target until ExpirationTime.
type CapacityReservation struct {