diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 708e699..47affcd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,3 +61,26 @@ jobs: echo Output version is empty! exit 1 fi + test-action-0-4-0: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - id: git-describe-semver + uses: choffmeister/git-describe-semver@main + with: + version: 0.4.0 + dir: . + fallback: v0.0.0-init + drop-prefix: true + prerelease-prefix: prefix + prerelease-suffix: suffix + prerelease-timestamped: true + next-release: major + - name: Verify output + run: | + if [[ -z "${{ steps.git-describe-semver.outputs.version }}" ]]; then + echo Output version is empty! + exit 1 + fi diff --git a/action.yaml b/action.yaml index 31fc98c..3e0a347 100644 --- a/action.yaml +++ b/action.yaml @@ -52,7 +52,7 @@ runs: git-describe-semver \ ${{ format('--dir="{0}"', inputs.dir) }} \ ${{ format('--fallback="{0}"', inputs.fallback) }} \ - ${{ format('--drop-prefix="{0}"', inputs.drop-prefix) }} \ + ${{ inputs.drop-prefix == 'true' && format('--drop-prefix') || '' }} \ ${{ format('--prerelease-prefix="{0}"', inputs.prerelease-prefix) }} \ ${{ format('--prerelease-suffix="{0}"', inputs.prerelease-suffix) }} \ ${{ format('--prerelease-timestamped="{0}"', inputs.prerelease-timestamped) }} \