mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-09-18 16:43:10 +00:00
fix: remove underscore from URL-compliant slugs
This commit is contained in:
committed by
Romain Lespinasse
parent
6839855732
commit
812bd42f94
@@ -39,7 +39,7 @@ This GitHub Action will expose the slug/short values of [some GitHub environment
|
|||||||
<p>
|
<p>
|
||||||
|
|
||||||
- `SLUG_URL` on a variable to have a `slug` variable compliant to be used in an URL
|
- `SLUG_URL` on a variable to have a `slug` variable compliant to be used in an URL
|
||||||
- Like `SLUG` but `.` is also replaced by `-`
|
- Like `SLUG` but `.`, and `_` are also replaced by `-`
|
||||||
- `SHORT` on a variable will limit the string size to ~8 characters
|
- `SHORT` on a variable will limit the string size to ~8 characters
|
||||||
- Useful for _sha_ value
|
- Useful for _sha_ value
|
||||||
- `<KEY>_PART` on a variable will give a part of a variable defined by a key
|
- `<KEY>_PART` on a variable will give a part of a variable defined by a key
|
||||||
|
|||||||
16
action.yml
16
action.yml
@@ -26,30 +26,30 @@ runs:
|
|||||||
INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }}
|
INPUT_SLUG_MAXLENGTH: ${{ inputs.slug-maxlength }}
|
||||||
INPUT_SHORT_LENGTH: ${{ inputs.short-length }}
|
INPUT_SHORT_LENGTH: ${{ inputs.short-length }}
|
||||||
|
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_REPOSITORY
|
key: GITHUB_REPOSITORY
|
||||||
value: ${{ github.repository }}
|
value: ${{ github.repository }}
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_REF
|
key: GITHUB_REF
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
- uses: rlespinasse/slugify-value@v1.2.0
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_HEAD_REF
|
key: GITHUB_HEAD_REF
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_BASE_REF
|
key: GITHUB_BASE_REF
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
|
|
||||||
# Specific values
|
# Specific values
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_EVENT_REF
|
key: GITHUB_EVENT_REF
|
||||||
value: ${{ github.event.ref }}
|
value: ${{ github.event.ref }}
|
||||||
@@ -60,7 +60,7 @@ runs:
|
|||||||
- id: get-github-ref-name
|
- id: get-github-ref-name
|
||||||
run: echo "::set-output name=github-ref-name::$(echo "${{ github.head_ref || github.ref }}" | cut -d/ -f3)"
|
run: echo "::set-output name=github-ref-name::$(echo "${{ github.head_ref || github.ref }}" | cut -d/ -f3)"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_REF_NAME
|
key: GITHUB_REF_NAME
|
||||||
value: ${{ steps.get-github-ref-name.outputs.github-ref-name }}
|
value: ${{ steps.get-github-ref-name.outputs.github-ref-name }}
|
||||||
@@ -69,7 +69,7 @@ runs:
|
|||||||
- id: get-github-repository-owner-part
|
- id: get-github-repository-owner-part
|
||||||
run: echo "::set-output name=github-repository-owner-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f1)"
|
run: echo "::set-output name=github-repository-owner-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f1)"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_REPOSITORY_OWNER_PART
|
key: GITHUB_REPOSITORY_OWNER_PART
|
||||||
value: ${{ steps.get-github-repository-owner-part.outputs.github-repository-owner-part }}
|
value: ${{ steps.get-github-repository-owner-part.outputs.github-repository-owner-part }}
|
||||||
@@ -78,7 +78,7 @@ runs:
|
|||||||
- id: get-github-repository-name-part
|
- id: get-github-repository-name-part
|
||||||
run: echo "::set-output name=github-repository-name-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f2)"
|
run: echo "::set-output name=github-repository-name-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f2)"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.2.1
|
- uses: rlespinasse/slugify-value@v1.2.2
|
||||||
with:
|
with:
|
||||||
key: GITHUB_REPOSITORY_NAME_PART
|
key: GITHUB_REPOSITORY_NAME_PART
|
||||||
value: ${{ steps.get-github-repository-name-part.outputs.github-repository-name-part }}
|
value: ${{ steps.get-github-repository-name-part.outputs.github-repository-name-part }}
|
||||||
|
|||||||
Reference in New Issue
Block a user