Skip to content

Commit

Permalink
fix: webhook labels for workflow_job (#1133)
Browse files Browse the repository at this point in the history
* fix: pass runner labels to webhook as json array

* fix: log runner labels properly in webhook
  • Loading branch information
gertjanmaas committed Aug 26, 2021
1 parent 03165d1 commit 4b39fb9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/webhook/lambdas/webhook/src/webhook/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ function isRunnerNotAllowed(job: WorkflowJob): boolean {

console.debug(
`Received workflow job event with labels: '${JSON.stringify(job.workflow_job.labels)}'. The event does ${
runnerMatch ? '' : 'NOT'
} match the configured labels: '${JSON.stringify(runnerLabels)}'`,
runnerMatch ? '' : 'NOT '
}match the configured labels: '${Array.from(runnerLabels).join(',')}'`,
);
return !runnerMatch;
}
2 changes: 1 addition & 1 deletion modules/webhook/webhook.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_lambda_function" "webhook" {
ENVIRONMENT = var.environment
SQS_URL_WEBHOOK = var.sqs_build_queue.id
REPOSITORY_WHITE_LIST = jsonencode(var.repository_white_list)
RUNNER_LABELS = jsonencode(var.runner_extra_labels)
RUNNER_LABELS = jsonencode(split(",", var.runner_extra_labels))
}
}

Expand Down

1 comment on commit 4b39fb9

@russmac
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just writing an issue for this thanks!

Please sign in to comment.