Compare commits
2 Commits
b541f6049e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
240401b9cb | ||
|
|
aac6334380 |
@@ -68,12 +68,16 @@
|
|||||||
// Create commit message
|
// Create commit message
|
||||||
const protocolName = data.metadata.protocol || 'Unknown Protocol';
|
const protocolName = data.metadata.protocol || 'Unknown Protocol';
|
||||||
const analystName = data.metadata.analyst || 'Anonymous';
|
const analystName = data.metadata.analyst || 'Anonymous';
|
||||||
const commitMessage = `Bicorder reading: ${protocolName} by ${analystName} | Source: Protocol Bicorder v${APP_VERSION}`;
|
const commitMessage = `Bicorder reading: ${protocolName} by ${analystName} | Source: Protocol Bicorder v${data.version}`;
|
||||||
|
|
||||||
// Prepare the content (base64 encoded)
|
// Prepare the content (base64 encoded)
|
||||||
const jsonContent = JSON.stringify(data, null, 2);
|
const jsonContent = JSON.stringify(data, null, 2);
|
||||||
const base64Content = btoa(unescape(encodeURIComponent(jsonContent)));
|
const base64Content = btoa(unescape(encodeURIComponent(jsonContent)));
|
||||||
|
|
||||||
|
// Get current timestamp for commit
|
||||||
|
const now = new Date();
|
||||||
|
const commitDate = now.toISOString();
|
||||||
|
|
||||||
// Upload to Gitea
|
// Upload to Gitea
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${GITEA_API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/contents/${filepath}`,
|
`${GITEA_API_URL}/repos/${REPO_OWNER}/${REPO_NAME}/contents/${filepath}`,
|
||||||
@@ -89,6 +93,10 @@
|
|||||||
content: base64Content,
|
content: base64Content,
|
||||||
message: commitMessage,
|
message: commitMessage,
|
||||||
branch: 'main',
|
branch: 'main',
|
||||||
|
dates: {
|
||||||
|
author: commitDate,
|
||||||
|
committer: commitDate,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user