Skip to content

Commit 98c3009

Browse files
committed
feat(workflow): add GitHub token for checksum management
1 parent fd9b7d9 commit 98c3009

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/build_app.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ jobs:
373373
env:
374374
RELEASE_ID: ${{ github.event.client_payload.release_id }}
375375
with:
376+
github-token: ${{ secrets.YGUI_TOKEN }}
376377
script: |
377378
const releaseId = parseInt(process.env.RELEASE_ID);
378379
@@ -399,6 +400,7 @@ jobs:
399400
env:
400401
RELEASE_ID: ${{ steps.check.outputs.release_id }}
401402
with:
403+
github-token: ${{ secrets.YGUI_TOKEN }}
402404
script: |
403405
const fs = require('fs');
404406
const crypto = require('crypto');
@@ -431,6 +433,17 @@ jobs:
431433
432434
fs.writeFileSync('dist/checksums.txt', checksums);
433435
436+
// Delete existing checksums.txt if present
437+
const existingChecksum = release.assets.find(a => a.name === 'checksums.txt');
438+
if (existingChecksum) {
439+
console.log('Deleting existing checksums.txt...');
440+
await github.rest.repos.deleteReleaseAsset({
441+
owner: context.repo.owner,
442+
repo: context.repo.repo,
443+
asset_id: existingChecksum.id
444+
});
445+
}
446+
434447
// Upload checksums
435448
await github.rest.repos.uploadReleaseAsset({
436449
owner: context.repo.owner,
@@ -464,6 +477,7 @@ jobs:
464477
env:
465478
RELEASE_ID: ${{ steps.check.outputs.release_id }}
466479
with:
480+
github-token: ${{ secrets.YGUI_TOKEN }}
467481
script: |
468482
const fs = require('fs');
469483
const releaseId = parseInt(process.env.RELEASE_ID);

0 commit comments

Comments
 (0)