mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-23 06:36:33 +00:00
Keep artifacts from the previous days in the nightly release
This commit is contained in:
+19
-19
@@ -159,26 +159,26 @@ jobs:
|
||||
archive: false
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Remove Previous Artifacts
|
||||
if: steps.check_release.outputs.release_exists == 'true'
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
const releaseId = ${{ steps.check_release.outputs.release_id }};
|
||||
const assets = await github.rest.repos.listReleaseAssets({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: releaseId,
|
||||
});
|
||||
# - name: Remove Previous Artifacts
|
||||
# if: steps.check_release.outputs.release_exists == 'true'
|
||||
# uses: actions/github-script@v8
|
||||
# with:
|
||||
# script: |
|
||||
# const releaseId = ${{ steps.check_release.outputs.release_id }};
|
||||
# const assets = await github.rest.repos.listReleaseAssets({
|
||||
# owner: context.repo.owner,
|
||||
# repo: context.repo.repo,
|
||||
# release_id: releaseId,
|
||||
# });
|
||||
|
||||
for (const asset of assets.data) {
|
||||
await github.rest.repos.deleteReleaseAsset({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
asset_id: asset.id,
|
||||
});
|
||||
console.log(`Deleted asset: ${asset.name}`);
|
||||
}
|
||||
# for (const asset of assets.data) {
|
||||
# await github.rest.repos.deleteReleaseAsset({
|
||||
# owner: context.repo.owner,
|
||||
# repo: context.repo.repo,
|
||||
# asset_id: asset.id,
|
||||
# });
|
||||
# console.log(`Deleted asset: ${asset.name}`);
|
||||
# }
|
||||
|
||||
- name: Upload Artifact to Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
Reference in New Issue
Block a user