From 1f8f474abe0de491760272aaae11d0b9bbc457a8 Mon Sep 17 00:00:00 2001
From: erri120 <erri120@protonmail.com>
Date: Sun, 21 Mar 2021 06:59:32 +0100
Subject: [PATCH] Add upload_url as action output (#75)

* Add upload_url as action output

* Update README
---
 README.md   | 1 +
 action.yml  | 2 ++
 src/main.ts | 1 +
 3 files changed, 4 insertions(+)

diff --git a/README.md b/README.md
index 5a85047..bf877bc 100644
--- a/README.md
+++ b/README.md
@@ -193,6 +193,7 @@ The following outputs can be accessed via `${{ steps.<step-id>.outputs }}` from
 | Name        | Type    | Description                                                     |
 |-------------|---------|-----------------------------------------------------------------|
 | `url`       | String  | Github.com URL for the release                                  |
+| `upload_url`| String  | URL for uploading assets to the release                         |
 
 
 #### environment variables
diff --git a/action.yml b/action.yml
index ab29e8a..dff78d6 100644
--- a/action.yml
+++ b/action.yml
@@ -35,6 +35,8 @@ env:
 outputs:
   url:
     description: 'URL to the Release HTML Page'
+  upload_url:
+    description: 'URL for uploading assets to the release'
 runs:
   using: 'node12'
   main: 'dist/index.js'
diff --git a/src/main.ts b/src/main.ts
index 47ae8b8..df7264e 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -55,6 +55,7 @@ async function run() {
     }
     console.log(`🎉 Release ready at ${rel.html_url}`);
     setOutput("url", rel.html_url);
+    setOutput("upload_url", rel.upload_url);
   } catch (error) {
     setFailed(error.message);
   }