Sync Feature: manual #2

Merged
someone merged 13 commits from sync/manual-20260425-0644 into main 2026-04-25 00:03:07 +00:00
Showing only changes of commit 5dbf81ca0f - Show all commits
+46
View File
@@ -0,0 +1,46 @@
/**
* WorkflowConfig - Centralized configuration management
* Uses PropertiesService to keep secrets out of the codebase.
*/
function getWorkflowConfig() {
const props = PropertiesService.getScriptProperties().getProperties();
return props;
}
function getRequiredProperty_(key) {
const value = PropertiesService.getScriptProperties().getProperty(key);
if (!value) {
throw new Error(`Missing required configuration property: ${key}. Please set it in Project Settings > Script Properties.`);
}
return value;
}
function getOptionalProperty_(key, fallback) {
const value = PropertiesService.getScriptProperties().getProperty(key);
return value !== null ? value : fallback;
}
function getVikunjaConfig() {
return {
baseUrl: getRequiredProperty_('VIKUNJA_BASE_URL'),
token: getRequiredProperty_('VIKUNJA_TOKEN'),
projectId: getOptionalProperty_('VIKUNJA_DEFAULT_PROJECT_ID', null)
};
}
function getTestProjectConfig() {
return {
testProjectId: getOptionalProperty_('VIKUNJA_TEST_PROJECT_ID', null)
};
}
function getGiteaConfig() {
return {
baseUrl: getRequiredProperty_('GITEA_BASE_URL'),
token: getRequiredProperty_('GITEA_TOKEN'),
owner: getRequiredProperty_('GITEA_OWNER'),
repo: getRequiredProperty_('GITEA_REPO'),
branch: getOptionalProperty_('GITEA_DEFAULT_BRANCH', 'main')
};
}