Skip to content

Commit

Permalink
gh-actions/str/sub: Make min not required (#916)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored Nov 2, 2023
1 parent 1319bec commit 39702a5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gh-actions/str/sub/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@

inputs:
string:
required: true
start:
type: number
default: 0
length:
type: number
required: true
min:
type: number
default: 0
start:
type: number
default: 0
string:
required: true

outputs:
string:
Expand All @@ -19,7 +20,7 @@ runs:
using: composite
steps:
- run: |
if [[ -z "$MIN" || "${#STRING}" -lt "${MIN}" ]]; then
if [[ "$MIN" -le 0 || "${#STRING}" -lt "${MIN}" ]]; then
echo "string=${STRING}" >> $GITHUB_OUTPUT
else
echo "string=${STRING:$START:$LENGTH}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 39702a5

Please sign in to comment.