Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Apr 30, 2024
1 parent 7e6ddaf commit f0aa7b7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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).
8 changes: 7 additions & 1 deletion action-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit f0aa7b7

Please sign in to comment.