Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 4b39fb9

Browse files
authored
fix: webhook labels for workflow_job (#1133)
* fix: pass runner labels to webhook as json array * fix: log runner labels properly in webhook
1 parent 03165d1 commit 4b39fb9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: modules/webhook/lambdas/webhook/src/webhook/handler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ function isRunnerNotAllowed(job: WorkflowJob): boolean {
131131

132132
console.debug(
133133
`Received workflow job event with labels: '${JSON.stringify(job.workflow_job.labels)}'. The event does ${
134-
runnerMatch ? '' : 'NOT'
135-
} match the configured labels: '${JSON.stringify(runnerLabels)}'`,
134+
runnerMatch ? '' : 'NOT '
135+
}match the configured labels: '${Array.from(runnerLabels).join(',')}'`,
136136
);
137137
return !runnerMatch;
138138
}

Diff for: modules/webhook/webhook.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ resource "aws_lambda_function" "webhook" {
1515
ENVIRONMENT = var.environment
1616
SQS_URL_WEBHOOK = var.sqs_build_queue.id
1717
REPOSITORY_WHITE_LIST = jsonencode(var.repository_white_list)
18-
RUNNER_LABELS = jsonencode(var.runner_extra_labels)
18+
RUNNER_LABELS = jsonencode(split(",", var.runner_extra_labels))
1919
}
2020
}
2121

0 commit comments

Comments
 (0)