From 0ed8b75fbc3a2b90afe59bbdd24898e37de796cb Mon Sep 17 00:00:00 2001 From: Giao Ho Date: Sat, 3 Apr 2021 17:46:33 +0700 Subject: [PATCH] Update README --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdaac87..cb6c38c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,26 @@ # Get Release -GitHub Action to get release +GitHub Action to get release. +Useful when you want to get upload_url of current release then upload additional assets by the [`@actions/upload-release-asset`](https://www.github.com/actions/upload-release-asset) GitHub Action. ## Usage See [action.yml](action.yml) +# Outputs + +For more information on these outputs, see the [API Documentation](https://developer.github.com/v3/repos/releases/#response-4) for an example of what these outputs look like + +- `id`: The release ID +- `html_url`: The URL users can navigate to in order to view the release. ex: `https://github.com/octocat/Hello-World/releases/v1.0.0` +- `upload_url`: The URL for uploading assets to the release, which could be used by GitHub Actions for additional uses, for example the [`@actions/upload-release-asset`](https://www.github.com/actions/upload-release-asset) GitHub Action +- `tag_name`: The git tag associated with the release. ex: `v1.1.0` +- `prerelease`: Whether the release is a pre-release + ## Get Current Release +If you don't specify `tag_name` and `latest` in your inputs the action will be get release of current release if available + ```yaml name: Upload Asset To Current Release on: @@ -25,6 +38,8 @@ jobs: - name: Get Current Release id: get_current_release uses: joutvhu/get-release@v1 + with: + debug: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -41,6 +56,8 @@ jobs: ## Get Release By Tag Name +You can specify the exact `tag_name` of release you want to get + ```yaml steps: - uses: joutvhu/get-release@v1 @@ -52,13 +69,16 @@ steps: ## Get The Latest Release +Set `latest: true` to find the latest release whose tag_name matches `pattern`. +Set `prerelease: true` to search for releases that include pre-releases. + ```yaml steps: - uses: joutvhu/get-release@v1 with: latest: true # Tag name start with `v` - pattern: v.* + pattern: '^v.*' # Including pre-release prerelease: true env: