Change workflow queries to use API to get global workflows (#1688)

This commit is contained in:
Shuchang Zheng
2025-02-01 03:06:09 +08:00
committed by GitHub
parent 5009355cb0
commit f38ba59bed
9 changed files with 137 additions and 69 deletions

View File

@@ -21,29 +21,10 @@ if (!artifactApiBaseUrl) {
const apiPathPrefix = import.meta.env.VITE_API_PATH_PREFIX ?? "";
function getGlobalWorkflowIds(): Array<string> {
const globalWorkflowIds = import.meta.env.VITE_GLOBAL_WORKFLOW_IDS;
if (!globalWorkflowIds) {
return [];
}
try {
const globalWorkflowIdsAsAList = JSON.parse(globalWorkflowIds);
if (Array.isArray(globalWorkflowIdsAsAList)) {
return globalWorkflowIdsAsAList;
}
return [];
} catch {
return [];
}
}
const globalWorkflowIds = getGlobalWorkflowIds();
export {
apiBaseUrl,
environment,
envCredential,
artifactApiBaseUrl,
apiPathPrefix,
globalWorkflowIds,
};