diff --git a/app/gitea.js b/app/gitea.js index cbd59d4..6219f5a 100644 --- a/app/gitea.js +++ b/app/gitea.js @@ -41,14 +41,15 @@ export async function commitFile(filePath, content, message) { ...(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({ method: sha ? 'put' : 'post', url, - headers: headers(), + headers: { ...headers(), 'Content-Type': 'application/json' }, httpsAgent, timeout: 30000, - data: payload, + data: JSON.stringify(payload), }); + console.log(` [debug] response status=${resp.status}`); return resp.data; }