Skip to content

Commit

Permalink
Added optional comment to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
obany committed Dec 20, 2019
1 parent fdff4a6 commit 127cd44
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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=",
Expand All @@ -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:
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions src/tangle-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 127cd44

Please sign in to comment.