Closed jonathanmorley closed 1 month ago
Thanks 🤦🏻
I'm using the following patch in case it helps others
- let executionName = `${payload.repository.full_name.replace("/", "-")}-${getHeader(event, "x-github-delivery")}`.slice(0, 64);
+ let deliveryId = getHeader(event, "x-github-delivery");
+ let executionName = `${payload.repository.full_name.replace("/", "-").slice(0, 64-deliveryId.length-1)}-${deliveryId}`;
which does middle-out truncation
This line (https://github.com/CloudSnorkel/cdk-github-runners/blob/main/src/webhook-handler.lambda.ts#L179) in the webhook handler lambda tries to calculate a unique name for the statemachine execution.
However, if the org name and/or repo name is long enough, then there is not enough space for the (actually unique)
x-github-delivery
header.I have encountered collisions with a 19 character org name, and a 42 character repository name, as this results in a combined 63 characters (including separators), leaving only 1 character for the
x-github-delivery
header.I suggest reducing each component individually, and maintaining a minimum hash length that the
x-github-delivery
header cannot go below.