Skip to content

Commit

Permalink
fix: remove trailing hypen if any after cut
Browse files Browse the repository at this point in the history
  • Loading branch information
rlespinasse committed Jun 16, 2022
1 parent 33cd7a7 commit 0141d9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ This GitHub Action will expose the slug/short values of [some GitHub environment

- put the variable content in lower case
- replace any character by `-` except `0-9`, `a-z`, `.`, and `_`
- remove leading and trailing `-` character
- remove leading `-` characters
- limit the string size to 63 characters
- remove trailing `-` characters

<details>
<summary>Others <b>Slug-ish</b> commands are available</summary>
Expand Down
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ runs:
INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }}
INPUT_SHORT_LENGTH: ${{ inputs.short-length }}

- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_REPOSITORY
value: ${{ github.repository }}
prefix: ${{ inputs.prefix }}
slug-maxlength: ${{ inputs.slug-maxlength }}
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_REF
prefix: ${{ inputs.prefix }}
slug-maxlength: ${{ inputs.slug-maxlength }}
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_HEAD_REF
prefix: ${{ inputs.prefix }}
slug-maxlength: ${{ inputs.slug-maxlength }}
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_BASE_REF
prefix: ${{ inputs.prefix }}
slug-maxlength: ${{ inputs.slug-maxlength }}

# Specific values
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_EVENT_REF
value: ${{ github.event.ref }}
Expand All @@ -60,7 +60,7 @@ runs:
- id: get-github-ref-name
run: echo "::set-output name=github-ref-name::${{ github.head_ref || github.ref_name }}"
shell: bash
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_REF_NAME
value: ${{ steps.get-github-ref-name.outputs.github-ref-name }}
Expand All @@ -69,7 +69,7 @@ runs:
- id: get-github-repository-owner-part
run: echo "::set-output name=github-repository-owner-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f1)"
shell: bash
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_REPOSITORY_OWNER_PART
value: ${{ steps.get-github-repository-owner-part.outputs.github-repository-owner-part }}
Expand All @@ -78,7 +78,7 @@ runs:
- id: get-github-repository-name-part
run: echo "::set-output name=github-repository-name-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f2)"
shell: bash
- uses: rlespinasse/slugify-value@v1.2.3
- uses: rlespinasse/slugify-value@v1.3.2
with:
key: GITHUB_REPOSITORY_NAME_PART
value: ${{ steps.get-github-repository-name-part.outputs.github-repository-name-part }}
Expand Down

0 comments on commit 0141d9b

Please sign in to comment.