fix(publishing): preserve newest metadata during release registration
This commit is contained in:
+9
-4
@@ -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)];
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user