Release ForgeFlow 0.8.5 trusted asset downloads

This commit is contained in:
NuklearRabbit
2026-07-26 02:46:34 +02:00
parent 095342b882
commit 1310d2e5a7
10 changed files with 69 additions and 29 deletions
+8
View File
@@ -331,6 +331,14 @@ class GiteaService {
throw new Error("The update download exceeded the redirect limit.");
}
async downloadReleaseAsset(owner, repo, assetId, options = {}) {
const numericId = Number(assetId);
if (!Number.isSafeInteger(numericId) || numericId <= 0)
throw new Error("Gitea returned an invalid release asset ID.");
const assetPath = `/api/v1/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/releases/assets/${numericId}`;
return this.downloadAuthenticated(assetPath, options);
}
async dispatchWorkflow({ owner, repo, workflowFile, ref, inputs = {} }) {
const result = await this.request(
`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/actions/workflows/${encodeURIComponent(workflowFile)}/dispatches`,