Skip to content

Commit

Permalink
Merge pull request #10 from cytopia/release-0.1.9
Browse files Browse the repository at this point in the history
Use booleans instead of 0/1
  • Loading branch information
cytopia authored Mar 29, 2022
2 parents d3dca11 + 1fad1cf commit ff96863
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ This composite action creates a stringified JSON list of git refs to be used as

The following inputs can be used to alter the Docker tag name determination:

| Input | Required | Default | Description |
|--------------------------------|----------|----------|-------------------------------------------------------------------------------------------------------|
| `repository_default_branch` | No | `master` | Optionally to fetch x number of latest tags from repository's main branch to add to the build matrix. |
| `branches` | No | `` | Optionally specify a comma separated list of branches to add to the build matrix. |
| `tags` | No | `` | Optionally specify a comma separated list of tags to add to the build matrix. |
| `num_latest_tags` | No | `0` | Optionally add x number of latest git tags to the build matrix (requires `repository_default_branch` to point to your repository's main branch. |
| `disable_refs` | No | `0` | Optionally force to disable all refs alltogether by returning an empty matrix and has_refs=0. Values: `0`, `1`, `false`, `true` |
| Input | Type | Required | Default | Description |
|--------------------------------|---------|----------|----------|-------------------------------------------------------------------------------------------------------|
| `repository_default_branch` | string | No | `master` | Optionally to fetch x number of latest tags from repository's main branch to add to the build matrix. |
| `branches` | string | No | `` | Optionally specify a comma separated list of branches to add to the build matrix. |
| `tags` | string | No | `` | Optionally specify a comma separated list of tags to add to the build matrix. |
| `num_latest_tags` | number | No | `0` | Optionally add x number of latest git tags to the build matrix (requires `repository_default_branch` to point to your repository's main branch. |
| `disable_refs` | boolean | No | `false` | Optionally force to disable all refs alltogether by returning an empty matrix and has_refs=false. Values: `0`, `1`, `false`, `true` |


## :arrow_backward: Outputs

| Output | Description |
|--------------|-----------------------------------------------------------------------------|
| `matrix` | Stringified JSON build matrix. Example: `["master","v0.1.0"]` |
| `has_refs` | Flag (0 or 1) that tells if we have matrix refs or not. Example: `0` or `1` |
| Output | Type | Description |
|--------------|---------|---------------------------------------------------------------------------|
| `matrix` | string | Stringified JSON build matrix. Example: `["master","v0.1.0"]` |
| `has_refs` | boolean | Flag that tells if we have matrix refs or not. Example: `true` or `false` |


## :computer: Usage
Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ inputs:

outputs:
matrix:
description: "Stringified JSON build matrix for defined git refs. (list of strings)"
description: "(string) Stringified JSON build matrix for defined git refs. (list of strings)"
value: ${{ steps.set-matrix.outputs.matrix }}
has_refs:
description: "Flag (0 or 1) that tells if we have matrix (list not empty) refs or not (list empty)."
description: "(boolean) Flag that tells if we have matrix (list not empty) refs or not (list empty)."
value: ${{ steps.set-matrix.outputs.has_refs }}

runs:
Expand All @@ -58,9 +58,9 @@ runs:
### Output matrix
###
echo "::set-output name=matrix::[]"
echo "::set-output name=has_refs::0"
echo "::set-output name=has_refs::false"
echo "matrix=[]"
echo "has_refs=0"
echo "has_refs=false"
else
###
### Convert comma separated branches and tags to newline separated
Expand Down Expand Up @@ -127,9 +127,9 @@ runs:
### Set 'has_refs'
###
if [ "${JSON}" = "[]" ]; then
HAS_REFS="0"
HAS_REFS="false"
else
HAS_REFS="1"
HAS_REFS="true"
fi
echo "::set-output name=has_refs::${HAS_REFS}"
Expand Down

0 comments on commit ff96863

Please sign in to comment.