This commit is contained in:
@@ -60,13 +60,13 @@ app.whenReady().then(async () => {
|
||||
await fs.readFile(path.join(root, "package.json"), "utf8"),
|
||||
);
|
||||
const configPath = path.join(configuredUserData, "forgeflow-config.json");
|
||||
const config = await readOptionalConfig(configPath);
|
||||
const config = (await readOptionalConfig(configPath)) || {};
|
||||
const actionsToken = String(
|
||||
process.env.GITEA_TOKEN || process.env.FORGEFLOW_RELEASE_TOKEN || "",
|
||||
).trim();
|
||||
let token = actionsToken;
|
||||
if (!token) {
|
||||
if (!config?.gitea?.encryptedToken) {
|
||||
if (!config.gitea?.encryptedToken) {
|
||||
throw new Error(
|
||||
`No release token was supplied and no encrypted Gitea token was found in ${configPath}. Sign in to Gitea once from ForgeFlow or run from Gitea Actions with GITEA_TOKEN.`,
|
||||
);
|
||||
@@ -76,7 +76,7 @@ app.whenReady().then(async () => {
|
||||
);
|
||||
}
|
||||
const configuredBaseUrl =
|
||||
process.env.FORGEFLOW_RELEASE_BASE_URL || config?.gitea?.baseUrl;
|
||||
process.env.FORGEFLOW_RELEASE_BASE_URL || config.gitea?.baseUrl;
|
||||
if (!configuredBaseUrl) {
|
||||
throw new Error(
|
||||
"No Gitea release base URL was supplied. Set FORGEFLOW_RELEASE_BASE_URL or configure Gitea in ForgeFlow.",
|
||||
@@ -84,15 +84,15 @@ app.whenReady().then(async () => {
|
||||
}
|
||||
const baseUrl = normalizeBaseUrl(configuredBaseUrl);
|
||||
const owner = safeRepositoryPart(
|
||||
process.env.FORGEFLOW_RELEASE_OWNER || config?.updates?.owner || "Jens",
|
||||
process.env.FORGEFLOW_RELEASE_OWNER || config.updates?.owner || "Jens",
|
||||
"Release repository owner",
|
||||
);
|
||||
const repo = safeRepositoryPart(
|
||||
process.env.FORGEFLOW_RELEASE_REPO || config?.updates?.repo || "ForgeFlow",
|
||||
process.env.FORGEFLOW_RELEASE_REPO || config.updates?.repo || "ForgeFlow",
|
||||
"Release repository name",
|
||||
);
|
||||
const branch = safeRepositoryPart(
|
||||
process.env.FORGEFLOW_RELEASE_BRANCH || config?.updates?.branch || "main",
|
||||
process.env.FORGEFLOW_RELEASE_BRANCH || config.updates?.branch || "main",
|
||||
"Release branch",
|
||||
);
|
||||
const version = manifest.version;
|
||||
|
||||
Reference in New Issue
Block a user