You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Webhook incorrectly filtering workflow_job events based on labels #1132
I tried using the workflow_job event instead of check_run. The webhook is ignoring the job though because it thinks that the labels do not match the configured labels for my runner.
2021-08-24T14:42:12.675Z 0b278f9f-b863-4236-b0f8-7a88a5b15e6a DEBUG Received workflow job event with labels: '["my-label"]'. The event does NOT match the configured labels: '
{}
'
The configured labels is empty, and I think it's an issue with the way RUNNER_LABELS is stored. runner_extra_labels is a comma separated list of labels. That variable is mapped to the RUNNER_LABELS environment variable for the lambda, but the workflow_job handler is expecting the RUNNER_LABELS environment variable to be a proper json array.
function isRunnerNotAllowed(job: WorkflowJob): boolean {
const runnerLabelsEnv = (process.env.RUNNER_LABELS as string) || '[]';
const runnerLabels = new Set(JSON.parse(runnerLabelsEnv) as Array<string>);
@gertjanmaas can you have a look at the issue. I have just checked the default example which uses extra labels, and here it works fine. So maybe we have indeed an issue for an empty list.
I checked the code and it seems the labels are not transferred from the terraform module to the webhook environment variable correctly. I'll make a PR for this and test out a couple of situations (including no labels).
Not sure if I have time to do this today, but I'll try :)
Activity
npalm commentedon Aug 26, 2021
@gertjanmaas can you have a look at the issue. I have just checked the default example which uses extra labels, and here it works fine. So maybe we have indeed an issue for an empty list.
gertjanmaas commentedon Aug 26, 2021
I checked the code and it seems the labels are not transferred from the terraform module to the webhook environment variable correctly. I'll make a PR for this and test out a couple of situations (including no labels).
Not sure if I have time to do this today, but I'll try :)
mrmeyers99 commentedon Aug 26, 2021
For what it's worth my list was not empty. I had about 7 comma separated labels.
gertjanmaas commentedon Aug 26, 2021
Then I misunderstood the ticket, but it also doesn't work as expected when labels are entered. 🙂
npalm commentedon Aug 26, 2021
New release is out with a fix
russmac commentedon Aug 28, 2021
Thanks for this! @gertjanmaas @npalm @mrmeyers99