5959 Compress-Archive -Path "$tempPath\*" -DestinationPath "SandboxStart-$version.zip" -Force
6060 Remove-Item $tempPath -Recurse -Force
6161
62- - name : Create or Update Release with API
62+ - name : Create or Update Release
6363 uses : actions/github-script@v7
6464 with :
6565 script : |
7676 });
7777 existingBody = release.body || '';
7878 } catch (error) {
79- console.log('No existing release found, will create new one ');
79+ console.log('No existing release found');
8080 }
8181
8282 // Create header with proper line breaks
@@ -88,15 +88,15 @@ jobs:
8888
8989 const fullBody = header + existingBody;
9090
91- // Try to update existing release, or create new one
91+ // Try to update or create release
9292 try {
9393 const { data: release } = await github.rest.repos.getReleaseByTag({
9494 owner: context.repo.owner,
9595 repo: context.repo.repo,
9696 tag: tag
9797 });
9898
99- // Update existing release
99+ // Update existing
100100 await github.rest.repos.updateRelease({
101101 owner: context.repo.owner,
102102 repo: context.repo.repo,
@@ -108,7 +108,7 @@ jobs:
108108 const zipPath = ` SandboxStart-${tag}.zip`;
109109 const zipContent = fs.readFileSync(zipPath);
110110
111- // Delete existing asset if it exists
111+ // Delete old asset
112112 for (const asset of release.assets) {
113113 if (asset.name === `SandboxStart-${tag}.zip`) {
114114 await github.rest.repos.deleteReleaseAsset({
@@ -119,7 +119,7 @@ jobs:
119119 }
120120 }
121121
122- // Upload new asset
122+ // Upload new
123123 await github.rest.repos.uploadReleaseAsset({
124124 owner : context.repo.owner,
125125 repo : context.repo.repo,
@@ -128,7 +128,6 @@ jobs:
128128 data : zipContent
129129 });
130130
131- console.log('Release updated successfully');
132131 } catch (error) {
133132 // Create new release
134133 const { data : newRelease } = await github.rest.repos.createRelease({
@@ -152,6 +151,4 @@ jobs:
152151 name : ` SandboxStart-${tag}.zip` ,
153152 data : zipContent
154153 });
155-
156- console.log('Release created successfully');
157154 }
0 commit comments