From 52b035f637d0d35bcba54e17ccda971e09e9b00d Mon Sep 17 00:00:00 2001 From: Sarah Edwards Date: Fri, 15 Oct 2021 15:31:02 -0700 Subject: [PATCH] Strip all non-alphanumeric characters from mutation ID (#22214) --- .github/actions-scripts/projects.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions-scripts/projects.js b/.github/actions-scripts/projects.js index 95146e4014..bf4b9a0bf6 100644 --- a/.github/actions-scripts/projects.js +++ b/.github/actions-scripts/projects.js @@ -164,10 +164,13 @@ export function generateUpdateProjectNextItemFieldMutation({ function generateMutationToUpdateField({ item, fieldID, value, literal = false }) { const parsedValue = literal ? `value: "${value}"` : `value: ${value}` - // Strip "=" out of the item ID when creating the mutation ID to avoid a GraphQL parsing error + // Strip all non-alphanumeric out of the item ID when creating the mutation ID to avoid a GraphQL parsing error // (statistically, this should still give us a unique mutation ID) return ` - set_${fieldID.substr(1)}_item_${item.replaceAll('=', '')}: updateProjectNextItemField(input: { + set_${fieldID.substr(1)}_item_${item.replaceAll( + /[^a-z0-9]/g, + '' + )}: updateProjectNextItemField(input: { projectId: $project itemId: "${item}" fieldId: ${fieldID}