feat: add option to set a different short length than git defaults

This commit is contained in:
rlespinasse
2022-03-21 09:14:25 +01:00
committed by Romain Lespinasse
parent 88f3ee8f6f
commit dbbe21b72b
4 changed files with 127 additions and 33 deletions

View File

@@ -13,6 +13,9 @@ inputs:
description: "Max length of the slugified values"
default: "63"
required: true
short-length:
description: "Length of the shortify values (git default if empty)"
required: false
runs:
using: "composite"
steps:
@@ -20,6 +23,7 @@ runs:
shell: bash
env:
INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }}
INPUT_SHORT_LENGTH: ${{ inputs.short-length }}
- uses: rlespinasse/slugify-value@v1.2.0
with:
@@ -85,12 +89,12 @@ runs:
with:
name: GITHUB_SHA
short-on-error: true
length: 8
length: ${{ inputs.short-length }}
prefix: ${{ inputs.prefix }}
- uses: rlespinasse/shortify-git-revision@v1.4.0
with:
name: GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
revision: ${{ github.event.pull_request.head.sha }}
short-on-error: true
length: 8
length: ${{ inputs.short-length }}
prefix: ${{ inputs.prefix }}