diff --git a/cmd/ic-assignment/main.go b/cmd/ic-assignment/main.go index a4dec9f..66b80d1 100644 --- a/cmd/ic-assignment/main.go +++ b/cmd/ic-assignment/main.go @@ -72,12 +72,14 @@ func main() { dryRun := githubaction.GetInputOrDefault("dry-run", "true") != "false" + labelsList := githubaction.GetInputOrDefault("labels", "") + action := &icassigner.Action{ Client: client, Config: cfg, } - err = action.Run(ctx, actionCtx, dryRun) + err = action.Run(ctx, actionCtx, labelsList, dryRun) if err != nil { log.Fatalf("Unable to run action: %v", err) } diff --git a/ic-assignment/action.yml b/ic-assignment/action.yml index 497a364..931f0b2 100644 --- a/ic-assignment/action.yml +++ b/ic-assignment/action.yml @@ -12,6 +12,10 @@ inputs: description: "With this option the decision only gets logged, but not change is made to the issue." required: false default: "true" + labels: + description: "With this option, the labels provided as a comma separated list will be the one used instead of the one in the issue." + required: false + default: "" gcal-service-acount-key: description: "Used to access google calendars in case of being configured for team members" required: false @@ -21,4 +25,4 @@ outputs: description: "The output property of the assigned person. If output property is empty, name is used instead" runs: using: "docker" - image: "docker://ghcr.io/grafana/issue-team-scheduler-ic-assignment:v0.14" + image: "docker://ghcr.io/grafana/issue-team-scheduler-ic-assignment:v0.15" diff --git a/pkg/icassigner/action.go b/pkg/icassigner/action.go index 00d51be..2892563 100644 --- a/pkg/icassigner/action.go +++ b/pkg/icassigner/action.go @@ -36,8 +36,11 @@ type Action struct { Config Config } -func (a *Action) Run(ctx context.Context, event *github.IssuesEvent, dryRun bool) error { +func (a *Action) Run(ctx context.Context, event *github.IssuesEvent, labelsInput string, dryRun bool) error { labels := convertLabels(event.Issue.Labels) + if labelsInput != "" { + labels = strings.Split(labelsInput, ",") + } for _, i := range a.Config.IgnoredLabels { for _, l := range labels { diff --git a/regex-labeler/action.yml b/regex-labeler/action.yml index 663faaa..9d27f6f 100644 --- a/regex-labeler/action.yml +++ b/regex-labeler/action.yml @@ -9,4 +9,4 @@ inputs: description: "GitHub token to use for API calls" runs: using: "docker" - image: "docker://ghcr.io/grafana/issue-team-scheduler-regex-labeler:v0.14" + image: "docker://ghcr.io/grafana/issue-team-scheduler-regex-labeler:v0.15"