debug: log content_len,改用 JSON.stringify

This commit is contained in:
2026-05-11 10:13:57 +00:00
parent 8acea007e7
commit 607c9b82ea
+4 -3
View File
@@ -41,14 +41,15 @@ export async function commitFile(filePath, content, message) {
...(sha ? { sha } : {}), ...(sha ? { sha } : {}),
}; };
console.log(` [debug] ${sha ? 'PUT' : 'POST'} ${url} branch=${PR_HEAD_BRANCH}`); console.log(` [debug] ${sha ? 'PUT' : 'POST'} ${url} branch=${PR_HEAD_BRANCH} content_len=${encoded.length}`);
const resp = await axios.request({ const resp = await axios.request({
method: sha ? 'put' : 'post', method: sha ? 'put' : 'post',
url, url,
headers: headers(), headers: { ...headers(), 'Content-Type': 'application/json' },
httpsAgent, httpsAgent,
timeout: 30000, timeout: 30000,
data: payload, data: JSON.stringify(payload),
}); });
console.log(` [debug] response status=${resp.status}`);
return resp.data; return resp.data;
} }