Skip to content

Commit

Permalink
Added release link
Browse files Browse the repository at this point in the history
  • Loading branch information
AButler committed Nov 20, 2023
1 parent 2f4df87 commit 2987c0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function run() {
}

const {
data: { upload_url: url },
data: { upload_url: upload_url, html_url: html_url },
} = await octokit.rest.repos.getRelease({ ...repo, release_id });

const { data: existingAssets } = await octokit.rest.repos.listReleaseAssets(
Expand Down Expand Up @@ -85,14 +85,16 @@ async function run() {

await octokit.rest.repos.uploadReleaseAsset({
...repo,
url: url as string,
url: upload_url as string,
release_id: release_id,
headers,
name: fileName,
// Octokits typings only accept string, but the code also accepts Buffer, so this tricks Typescript into allowing the buffer
data: fileStream as unknown as string,
});
}

console.log(`Upload complete: ${html_url}`);
} catch (error: any) {
const message = error?.message || "Unknown error";
core.setFailed(message);
Expand Down

0 comments on commit 2987c0e

Please sign in to comment.