From f0aa7b71d5ac889ba746407a538280c0d22be87d Mon Sep 17 00:00:00 2001 From: Socheat Sok <4363857+socheatsok78@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:38:38 +0700 Subject: [PATCH] Update README.md --- README.md | 33 +++++++++++++++++++++++++++++++++ action-test.sh | 8 +++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b496eb..60c890e 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ GitHub Action to generate matrix from GitHub's repository releases via GitHub AP ## Usage +You can now consume the action by referencing the `v1` branch + ```yaml on: push: @@ -38,3 +40,34 @@ jobs: **Example screenshot** ![Screenshot 2024-04-30 at 6 05 29 in the evening](https://github.com/actions-matrix/github-release-matrix-action/assets/4363857/125124b0-f870-4f09-8995-4d84359a2190) + +## Inputs + +- `repository`: Repository owner/name (e.g. "octocat/Hello-World")' +- `release`: Release filter (e.g. "latest", "*"). (Default: "*")' +- `prerelease`: Include prerelease releases. (Default: false)' +- `prefix`: Remove version prefix from release tag name. (Default: false)' +- `limit`: Limit the number of releases to fetch. (Default: 3)' + +## Outputs + +- `matrix`: JSON string with the matrix of releases. + +**Example** + +```json +{ + "releases": [ + { + "tag_name": "v1.16.2", + "target_commitish": "c6e4c2d4dc3b0d57791881b087c026e2f75a87cb", + "author": "hc-github-team-es-release-engineering", + "created_at": "2024-04-22T20:25:54Z", + "published_at": "2024-04-23T21:51:34Z" + } + ] +} +``` + +## License +Licensed under the [MIT License](LICENSE). diff --git a/action-test.sh b/action-test.sh index 3fb3efc..14600e0 100755 --- a/action-test.sh +++ b/action-test.sh @@ -8,4 +8,10 @@ export GITHUB_OUTPUT="${ACTION_DIR}/GITHUB_OUTPUT" mkdir -p "$RUNNER_TEMP" touch "$GITHUB_OUTPUT" -exec ./action.sh "prometheus/alertmanager" "${@}" +INPUT_REPOSITORY=${1:$INPUT_REPOSITORY} +INPUT_RELEASE=${2:-${INPUT_RELEASE:-"*"}} +INPUT_PRERELEASE=${3:-${INPUT_PRERELEASE:-"false"}} +INPUT_PREFIX=${4:-${INPUT_PREFIX:-"false"}} +INPUT_LIMIT=${5:-${INPUT_LIMIT:-"3"}} + +exec ./action.sh "${INPUT_REPOSITORY}" "${INPUT_RELEASE}" "${INPUT_PRERELEASE}" "${INPUT_PREFIX}" "${INPUT_LIMIT}"