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
'Thanks for submitting a new event. I could not generate the branch and pull request yet because a few fields need attention:',
126
+
'Thanks for submitting your event to Processing Community Day 2026! 🌍',
127
+
'',
128
+
`We couldn't create a pull request yet because **${count}${fieldWord} attention**:`,
119
129
'',
120
-
...errors.map((error)=>`- ${error}`),
130
+
...errors.map(formatError),
121
131
'',
122
-
'Please edit the issue with the missing or corrected information. Opening a fresh submission is also fine if that is easier.',
132
+
`Once you've edited the issue with the corrected information, this check will run again automatically. If you need help, post in the [PCD 2026 forum thread](${PCD_FORUM_THREAD_URL}).`,
if(eventDate&&!isValidDate(eventDate))errors.push(`Event date must use YYYY-MM-DD and be a real date. Received "${eventDate}".`);
189
-
if(eventEndDate&&!isValidDate(eventEndDate))errors.push(`End date must use YYYY-MM-DD and be a real date. Received "${eventEndDate}".`);
190
-
if(isValidDate(eventDate)&&eventEndDate&&isValidDate(eventEndDate)&&eventEndDate<eventDate)errors.push('End date cannot be earlier than event date.');
191
-
if(startTime&&!isValidTime(startTime))errors.push(`Start time must use 24-hour HH:MM. Received "${startTime}".`);
192
-
if(endTime&&!isValidTime(endTime))errors.push(`End time must use 24-hour HH:MM. Received "${endTime}".`);
204
+
if(eventDate&&!isValidDate(eventDate))errors.push({field: 'Event date',found: eventDate,message: 'Invalid format. Please use `YYYY-MM-DD`, e.g. `2026-03-21`.'});
205
+
if(eventEndDate&&!isValidDate(eventEndDate))errors.push({field: 'End date',found: eventEndDate,message: 'Invalid format. Please use `YYYY-MM-DD`, e.g. `2026-03-22`.'});
206
+
if(isValidDate(eventDate)&&eventEndDate&&isValidDate(eventEndDate)&&eventEndDate<eventDate)errors.push({field: 'End date',found: eventEndDate,message: 'The end date must be on or after the event date.'});
207
+
if(startTime&&!isValidTime(startTime))errors.push({field: 'Start time',found: startTime,message: 'Invalid format. Please use 24-hour `HH:MM`, e.g. `14:00`.'});
208
+
if(endTime&&!isValidTime(endTime))errors.push({field: 'End time',found: endTime,message: 'Invalid format. Please use 24-hour `HH:MM`, e.g. `16:30`.'});
193
209
if(
194
210
startTime&&
195
211
endTime&&
@@ -198,17 +214,17 @@ if (
198
214
(!eventEndDate||eventEndDate===eventDate)&&
199
215
endTime<=startTime
200
216
){
201
-
errors.push('End timemust be later than start time for single-day events.');
217
+
errors.push({field: 'End time',found: endTime,message: 'End time must be later than start time for single-day events.'});
202
218
}
203
-
if(eventWebsite&&!isValidHttpUrl(eventWebsite))errors.push(`Event website must be a valid http or https URL. Received "${eventWebsite}".`);
204
-
if(forumThreadUrl&&!isValidHttpUrl(forumThreadUrl))errors.push(`Forum discussion URL must be a valid http or https URL. Received "${forumThreadUrl}".`);
205
-
if(contactEmail&&!isValidEmail(contactEmail))errors.push(`Primary contact email is not valid. Received "${contactEmail}".`);
206
-
if(plusCode&&!isValidPlusCode(plusCode))errors.push(`Full global plus code is not valid. Received "${plusCode}".`);
207
-
if(eventUrl&&!isValidHttpUrl(eventUrl))errors.push(`Online event URL must be a valid http or https URL. Received "${eventUrl}".`);
208
-
if(organizationUrl&&!isValidHttpUrl(organizationUrl))errors.push(`Organization website must be a valid http or https URL. Received "${organizationUrl}".`);
209
-
if(eventFormat&&!VALID_EVENT_FORMATS.has(eventFormat))errors.push(`Event format "${eventFormat}" is not one of the valid options.`);
210
-
if(organizationType&&!VALID_ORG_TYPES.has(organizationType))errors.push(`Organization type "${organizationType}" is not one of the valid options.`);
211
-
if(isOnlineEvent&&!eventUrl)errors.push('Event URLis required for online events.');
219
+
if(eventWebsite&&!isValidHttpUrl(eventWebsite))errors.push({field: 'Event website',found: eventWebsite,message: 'Must be a valid URL starting with `http://` or `https://`, e.g. `https://example.com/pcd`.'});
220
+
if(forumThreadUrl&&!isValidHttpUrl(forumThreadUrl))errors.push({field: 'Forum discussion URL',found: forumThreadUrl,message: 'Must be a valid URL starting with `http://` or `https://`.'});
221
+
if(contactEmail&&!isValidEmail(contactEmail))errors.push({field: 'Primary contact email',found: contactEmail,message: 'Not a valid email address. Please provide a valid email like `you@example.com`.'});
222
+
if(plusCode&&!isValidPlusCode(plusCode))errors.push({field: 'Map placement (Plus Code)',found: plusCode,message: 'Not a valid full global Plus Code. It should look like `8FW4V75V+8Q`. [Find your Plus Code →](https://plus.codes/)'});
223
+
if(eventUrl&&!isValidHttpUrl(eventUrl))errors.push({field: 'Event URL',found: eventUrl,message: 'Must be a valid URL starting with `http://` or `https://`.'});
224
+
if(organizationUrl&&!isValidHttpUrl(organizationUrl))errors.push({field: 'Organization website',found: organizationUrl,message: 'Must be a valid URL starting with `http://` or `https://`.'});
225
+
if(eventFormat&&!VALID_EVENT_FORMATS.has(eventFormat))errors.push({field: 'Event format',found: eventFormat,message: 'Not a recognized option. Please choose one of: `In person` or `Online`.'});
226
+
if(organizationType&&!VALID_ORG_TYPES.has(organizationType))errors.push({field: 'Organization type',found: organizationType,message: 'Not a recognized option. Please choose one of the valid options from the form.'});
227
+
if(isOnlineEvent&&!eventUrl)errors.push({field: 'Event URL',message: 'An event URL is required for online events. Please provide the URL where people can join.'});
errors.push(`An event with the generated id "${eventId}" already exists. Update the existing event instead of creating a duplicate.`);
240
+
errors.push({field: 'Event name',found: eventName,message: `An event with the generated ID \`${eventId}\` already exists. If you need to update an existing event, post in the [PCD 2026 forum thread](${PCD_FORUM_THREAD_URL}) or contact ${PCD_EMAIL}.`});
225
241
}catch{
226
242
// Directory does not exist yet.
227
243
}
228
244
229
245
if(errors.length>0){
230
246
console.log(`[process-new-event-issue] validation failed with ${errors.length} error(s):`);
0 commit comments