fix(publishing): preserve newest metadata during release registration

This commit is contained in:
2026-09-11 10:09:22 +08:00
parent 07cf38b1a4
commit bf27410454
2 changed files with 17 additions and 7 deletions
+9 -4
View File
@@ -60,10 +60,15 @@ function authorization(token) {
if (token) return `token ${token}`;
if (process.env.GITEA_ACTIONS === 'true') throw new Error('Workflow token is missing');
if (!localAuthorization) {
const output = execFileSync('git', ['-c', 'credential.interactive=false', 'credential', 'fill'], {
input: `url=${server}\n\n`, encoding: 'utf8', timeout: 10_000,
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' }, stdio: ['pipe', 'pipe', 'ignore'],
});
let output;
try {
output = execFileSync('git', ['-c', 'credential.interactive=false', 'credential', 'fill'], {
input: `url=${server}\n\n`, encoding: 'utf8', timeout: 10_000,
env: { ...process.env, GIT_TERMINAL_PROMPT: '0' }, stdio: ['pipe', 'pipe', 'ignore'],
});
} catch {
throw new Error('Set GITEA_TOKEN or configure Git HTTPS credentials');
}
const fields = Object.fromEntries(output.trim().split('\n').map(line => {
const separator = line.indexOf('='); return [line.slice(0, separator), line.slice(separator + 1)];
}));