From 127cd44cb4eafba85eda5ac37edacfc75fd3a205 Mon Sep 17 00:00:00 2001 From: Martyn Janes Date: Fri, 20 Dec 2019 08:44:21 +0100 Subject: [PATCH] Added optional comment to payload --- README.md | 6 ++++-- dist/index.js | 2 ++ package-lock.json | 2 +- package.json | 2 +- src/tangle-release.js | 2 ++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4ea7c8e..87845ac 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The action will perform the following steps: ### Inputs - `tag_name`: The name of the tag for this release +- `comment`: An optional comment to include in the Tangle payload ### Outputs @@ -28,6 +29,7 @@ The action will perform the following steps: "repo": "test-repo", "tag_name": "v0.1.0", "name": "First full release", + "comment": "My Awesome Release", "body": "This is the body of the description.", "tarball_url": "https://api.github.com/repos/an-owner/test-repo/tarball/v0.1.0", "tarball_sig": "Me3ouGni0h50TOHQklopu3sJdLFh/ZVlPJom3aDRFVQ=", @@ -53,7 +55,7 @@ The action will perform the following steps: ## Usage Create a GitHub workflow in you repo e.g. `/.github/workflows/tangle-release.yml`. - Most of the environment variables are optional, except for the `IOTA_SEED` which must be 81 trytes in length. + Most of the environment variables are optional, except for the `IOTA_SEED` which must be 81 trytes in length. For more details on creating a seed see [IOTA Docs - Getting Started - Creating A Seed](https://docs.iota.org/docs/getting-started/0.1/tutorials/create-a-seed) ```yaml on: @@ -82,7 +84,7 @@ jobs: IOTA_EXPLORE_URL: ${{ secrets.IOTA_EXPLORE_URL }} # Optional, defaults to https://utils.iota.org/transaction/:hash with: tag_name: ${{ github.ref }} + comment: My Awesome Release ``` -## Returns \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 01da7bb..e01307c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -32051,6 +32051,7 @@ async function run() { const { owner, repo } = context.repo; const tagName = core.getInput('tag_name', { required: true }); + const comment = core.getInput('comment', { required: false }); const release = await github.repos.getReleaseByTag({ owner, @@ -32066,6 +32067,7 @@ async function run() { repo, tag_name: release.data.tag_name, name: release.data.name, + comment, body: release.data.body, tarball_url: release.data.tarball_url, tarball_sig: tarBallHash, diff --git a/package-lock.json b/package-lock.json index d9d3616..96e368f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gh-tangle-release", - "version": "1.0.0", + "version": "0.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9fb50c1..d5d28d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gh-tangle-release", - "version": "0.5.0", + "version": "0.5.1", "description": "Create a release and adds metadata to the tangle", "main": "dist/index.js", "scripts": { diff --git a/src/tangle-release.js b/src/tangle-release.js index f9accc4..c698f97 100644 --- a/src/tangle-release.js +++ b/src/tangle-release.js @@ -35,6 +35,7 @@ async function run() { const { owner, repo } = context.repo; const tagName = core.getInput('tag_name', { required: true }); + const comment = core.getInput('comment', { required: false }); const release = await github.repos.getReleaseByTag({ owner, @@ -50,6 +51,7 @@ async function run() { repo, tag_name: release.data.tag_name, name: release.data.name, + comment, body: release.data.body, tarball_url: release.data.tarball_url, tarball_sig: tarBallHash,