Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions actions/setup/js/update_project.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,12 @@ async function updateProject(output) {
// Detect expected field type based on field name and value heuristics
const datePattern = /^\d{4}-\d{2}-\d{2}$/;
const isDateField = fieldName.toLowerCase().includes("_date") || fieldName.toLowerCase().includes("date");
const isTextField = "classification" === fieldName.toLowerCase() || "campaign_id" === fieldName.toLowerCase() || ("string" == typeof fieldValue && fieldValue.includes("|"));
const isTextField =
"classification" === fieldName.toLowerCase() ||
"campaign_id" === fieldName.toLowerCase() ||
"target_repo" === fieldName.toLowerCase() ||
"worker_workflow" === fieldName.toLowerCase() ||
("string" == typeof fieldValue && fieldValue.includes("|"));
let expectedDataType;
if (isDateField && typeof fieldValue === "string" && datePattern.test(fieldValue)) {
expectedDataType = "DATE";
Expand Down Expand Up @@ -698,7 +703,13 @@ async function updateProject(output) {
core.warning(`Field "${fieldName}" looks like a date field but value "${fieldValue}" is not in YYYY-MM-DD format. Skipping field creation.`);
continue;
}
} else if ("classification" === fieldName.toLowerCase() || "campaign_id" === fieldName.toLowerCase() || ("string" == typeof fieldValue && fieldValue.includes("|")))
} else if (
"classification" === fieldName.toLowerCase() ||
"campaign_id" === fieldName.toLowerCase() ||
"target_repo" === fieldName.toLowerCase() ||
"worker_workflow" === fieldName.toLowerCase() ||
("string" == typeof fieldValue && fieldValue.includes("|"))
)
try {
field = (
await github.graphql(
Expand Down Expand Up @@ -842,7 +853,12 @@ async function updateProject(output) {
// Detect expected field type based on field name and value heuristics
const datePattern = /^\d{4}-\d{2}-\d{2}$/;
const isDateField = fieldName.toLowerCase().includes("_date") || fieldName.toLowerCase().includes("date");
const isTextField = "classification" === fieldName.toLowerCase() || "campaign_id" === fieldName.toLowerCase() || ("string" == typeof fieldValue && fieldValue.includes("|"));
const isTextField =
"classification" === fieldName.toLowerCase() ||
"campaign_id" === fieldName.toLowerCase() ||
"target_repo" === fieldName.toLowerCase() ||
"worker_workflow" === fieldName.toLowerCase() ||
("string" == typeof fieldValue && fieldValue.includes("|"));
let expectedDataType;
if (isDateField && typeof fieldValue === "string" && datePattern.test(fieldValue)) {
expectedDataType = "DATE";
Expand Down Expand Up @@ -877,7 +893,13 @@ async function updateProject(output) {
core.warning(`Field "${fieldName}" looks like a date field but value "${fieldValue}" is not in YYYY-MM-DD format. Skipping field creation.`);
continue;
}
} else if ("classification" === fieldName.toLowerCase() || "campaign_id" === fieldName.toLowerCase() || ("string" == typeof fieldValue && fieldValue.includes("|")))
} else if (
"classification" === fieldName.toLowerCase() ||
"campaign_id" === fieldName.toLowerCase() ||
"target_repo" === fieldName.toLowerCase() ||
"worker_workflow" === fieldName.toLowerCase() ||
("string" == typeof fieldValue && fieldValue.includes("|"))
)
try {
field = (
await github.graphql(
Expand Down
28 changes: 5 additions & 23 deletions specs/artifacts.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.