Fixed commit date issue on JSON upload

This commit is contained in:
Nathan Schneider
2025-11-25 13:38:38 -05:00
parent aac6334380
commit 240401b9cb

View File

@@ -74,6 +74,10 @@
const jsonContent = JSON.stringify(data, null, 2);
const base64Content = btoa(unescape(encodeURIComponent(jsonContent)));
// Get current timestamp for commit
const now = new Date();
const commitDate = now.toISOString();
// Upload to Gitea
const response = await fetch(
`${GITEA_API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/contents/${filepath}`,
@@ -89,6 +93,10 @@
content: base64Content,
message: commitMessage,
branch: 'main',
dates: {
author: commitDate,
committer: commitDate,
},
}),
}
);