mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 03:57:01 +00:00
Revert "feat: adding workflow_dispatch webhook event" (#879)
This reverts commit d36d47fe66.
This commit is contained in:
@@ -183,15 +183,6 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) Handle(w http.Respons
|
||||
"action", e.GetAction(),
|
||||
)
|
||||
}
|
||||
case *gogithub.WorkflowDispatchEvent:
|
||||
target, err = autoscaler.getScaleUpTarget(
|
||||
context.TODO(),
|
||||
log,
|
||||
e.Repo.GetName(),
|
||||
e.Repo.Owner.GetLogin(),
|
||||
e.Repo.Owner.GetType(),
|
||||
autoscaler.WorkflowDispatchEvent(e),
|
||||
)
|
||||
case *gogithub.WorkflowJobEvent:
|
||||
if workflowJob := e.GetWorkflowJob(); workflowJob != nil {
|
||||
log = log.WithValues(
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
|
||||
"github.com/google/go-github/v37/github"
|
||||
)
|
||||
|
||||
// MatchPushEvent()
|
||||
func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) MatchWorkflowDispatchEvent(event *github.PushEvent) func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool {
|
||||
return func(scaleUpTrigger v1alpha1.ScaleUpTrigger) bool {
|
||||
g := scaleUpTrigger.GitHubEvent
|
||||
|
||||
if g == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
WorkflowDispatch := g.WorkflowDispatch
|
||||
|
||||
if WorkflowDispatch == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
// event.Ref = Branch that received dispatch
|
||||
// event.Ref = refs/heads/branch-name
|
||||
if !matchTriggerConditionAgainstEvent(WorkflowDispatch.Branches, event.Ref) {
|
||||
return false
|
||||
}
|
||||
|
||||
if matchTriggerConditionAgainstEvent(WorkflowDispatch.BranchesIgnore, event.Ref) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user