mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-10 16:43:09 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b011e83cf8 | ||
|
|
00198f8992 | ||
|
|
9c3571fd3d |
40
.github/workflows/v4-tests-and-release.yml
vendored
40
.github/workflows/v4-tests-and-release.yml
vendored
@@ -1,8 +1,8 @@
|
|||||||
name: "[v4] Test and Release"
|
name: '[v4] Test and Release'
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
check-v3compatibility:
|
check-v3compatibility:
|
||||||
name: "Check v3 compatibility"
|
name: 'Check v3 compatibility'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -84,7 +84,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
check-v3compatibility-without-checkout:
|
check-v3compatibility-without-checkout:
|
||||||
name: "Check v3 compatibility (without checkout)"
|
name: 'Check v3 compatibility (without checkout)'
|
||||||
needs:
|
needs:
|
||||||
- check-v3compatibility
|
- check-v3compatibility
|
||||||
strategy:
|
strategy:
|
||||||
@@ -115,7 +115,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
display:
|
display:
|
||||||
name: "Display produced variables"
|
name: 'Display produced variables'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -191,7 +191,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
display-without-checkout:
|
display-without-checkout:
|
||||||
name: "Display produced variables (without checkout)"
|
name: 'Display produced variables (without checkout)'
|
||||||
needs:
|
needs:
|
||||||
- display
|
- display
|
||||||
strategy:
|
strategy:
|
||||||
@@ -236,7 +236,7 @@ jobs:
|
|||||||
- name: Using correct short length
|
- name: Using correct short length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "CSL_"
|
prefix: 'CSL_'
|
||||||
short-length: 4
|
short-length: 4
|
||||||
- name: Using correct length // Validate that all short variables lengths are equals to short-length
|
- name: Using correct length // Validate that all short variables lengths are equals to short-length
|
||||||
run: |
|
run: |
|
||||||
@@ -248,8 +248,8 @@ jobs:
|
|||||||
id: using-wrong-short-length
|
id: using-wrong-short-length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "WSL_"
|
prefix: 'WSL_'
|
||||||
short-length: "wrong"
|
short-length: 'wrong'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Using wrong short length // Validate that the action end with an error
|
- name: Using wrong short length // Validate that the action end with an error
|
||||||
run: |
|
run: |
|
||||||
@@ -278,7 +278,7 @@ jobs:
|
|||||||
- name: Using correct short length
|
- name: Using correct short length
|
||||||
uses: ./this-action
|
uses: ./this-action
|
||||||
with:
|
with:
|
||||||
prefix: "CSL_"
|
prefix: 'CSL_'
|
||||||
short-length: 4
|
short-length: 4
|
||||||
- name: Using correct length // Validate that all short variables lengths are equals to short-length
|
- name: Using correct length // Validate that all short variables lengths are equals to short-length
|
||||||
run: |
|
run: |
|
||||||
@@ -290,7 +290,7 @@ jobs:
|
|||||||
id: using-empty-short-length
|
id: using-empty-short-length
|
||||||
uses: ./this-action
|
uses: ./this-action
|
||||||
with:
|
with:
|
||||||
prefix: "ESL_"
|
prefix: 'ESL_'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Using empty short length // Validate that the action don't end with an error
|
- name: Using empty short length // Validate that the action don't end with an error
|
||||||
run: |
|
run: |
|
||||||
@@ -304,8 +304,8 @@ jobs:
|
|||||||
id: using-wrong-short-length
|
id: using-wrong-short-length
|
||||||
uses: ./this-action
|
uses: ./this-action
|
||||||
with:
|
with:
|
||||||
prefix: "WSL_"
|
prefix: 'WSL_'
|
||||||
short-length: "wrong"
|
short-length: 'wrong'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Using wrong short length // Validate that the action end with an error
|
- name: Using wrong short length // Validate that the action end with an error
|
||||||
run: |
|
run: |
|
||||||
@@ -329,7 +329,7 @@ jobs:
|
|||||||
- name: Using correct slug max length
|
- name: Using correct slug max length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "CML_"
|
prefix: 'CML_'
|
||||||
slug-maxlength: 1
|
slug-maxlength: 1
|
||||||
- name: Using correct max length // Validate that all slug variables lengths are equals or under the slug-maxlength
|
- name: Using correct max length // Validate that all slug variables lengths are equals or under the slug-maxlength
|
||||||
run: |
|
run: |
|
||||||
@@ -341,8 +341,8 @@ jobs:
|
|||||||
id: using-wrong-slug-max-length
|
id: using-wrong-slug-max-length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "WML_"
|
prefix: 'WML_'
|
||||||
slug-maxlength: "wrong"
|
slug-maxlength: 'wrong'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Using wrong slug max length // Validate that the action end with an error
|
- name: Using wrong slug max length // Validate that the action end with an error
|
||||||
run: |
|
run: |
|
||||||
@@ -356,8 +356,8 @@ jobs:
|
|||||||
id: using-empty-slug-max-length
|
id: using-empty-slug-max-length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "EML_"
|
prefix: 'EML_'
|
||||||
slug-maxlength: ""
|
slug-maxlength: ''
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Using empty slug max length // Validate that the action end with an error
|
- name: Using empty slug max length // Validate that the action end with an error
|
||||||
run: |
|
run: |
|
||||||
@@ -371,8 +371,8 @@ jobs:
|
|||||||
id: using-nolimit-slug-max-length
|
id: using-nolimit-slug-max-length
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: "NLML_"
|
prefix: 'NLML_'
|
||||||
slug-maxlength: "nolimit"
|
slug-maxlength: 'nolimit'
|
||||||
- name: Using no limit on slug max length // Validate that the action end with an error
|
- name: Using no limit on slug max length // Validate that the action end with an error
|
||||||
run: |
|
run: |
|
||||||
[[ "$(env | grep "NLML_" | grep "_SLUG" | wc -l)" -gt 0 ]]
|
[[ "$(env | grep "NLML_" | grep "_SLUG" | wc -l)" -gt 0 ]]
|
||||||
@@ -394,5 +394,3 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Release this GitHub Action
|
- name: Release this GitHub Action
|
||||||
uses: rlespinasse/release-that@v1
|
uses: rlespinasse/release-that@v1
|
||||||
with:
|
|
||||||
without-prefix: true
|
|
||||||
|
|||||||
@@ -246,15 +246,13 @@ Please, use the current major tag `v4` or a version tag (see [releases pages][re
|
|||||||
- [Github Actions : enfin des pipelines accessibles aux développeurs][talk-1] (in french :fr:)
|
- [Github Actions : enfin des pipelines accessibles aux développeurs][talk-1] (in french :fr:)
|
||||||
- The next one is you. _Don't hesitate to add youself to this list._
|
- The next one is you. _Don't hesitate to add youself to this list._
|
||||||
|
|
||||||
[actions]: https://github.com/rlespinasse/github-slug-action/actions
|
|
||||||
[license]: https://github.com/rlespinasse/github-slug-action/blob/v4.x/LICENSE
|
|
||||||
[examples]: https://github.com/rlespinasse/github-slug-action/tree/v4.x/examples
|
[examples]: https://github.com/rlespinasse/github-slug-action/tree/v4.x/examples
|
||||||
[custom-variable]: https://github.com/rlespinasse/github-slug-action/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=
|
[custom-variable]: https://github.com/rlespinasse/github-slug-action/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=
|
||||||
[releases]: https://github.com/rlespinasse/github-slug-action/releases
|
[releases]: https://github.com/rlespinasse/github-slug-action/releases
|
||||||
[issue-15]: https://github.com/rlespinasse/github-slug-action/issues/15
|
[issue-15]: https://github.com/rlespinasse/github-slug-action/issues/15
|
||||||
[issue-104]: https://github.com/rlespinasse/github-slug-action/issues/104
|
[issue-104]: https://github.com/rlespinasse/github-slug-action/issues/104
|
||||||
|
|
||||||
[git-revpars]: https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---shortlength
|
[git-revparse]: https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---shortlength
|
||||||
[git-core-abbrev]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreabbrev
|
[git-core-abbrev]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-coreabbrev
|
||||||
|
|
||||||
[default-environment-variables]: https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
[default-environment-variables]: https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
||||||
|
|||||||
26
action.yml
26
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.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
with:
|
with:
|
||||||
key: GITHUB_EVENT_REF
|
key: GITHUB_EVENT_REF
|
||||||
value: ${{ github.event.ref }}
|
value: ${{ github.event.ref }}
|
||||||
@@ -58,27 +58,27 @@ runs:
|
|||||||
|
|
||||||
# Calculated values
|
# Calculated values
|
||||||
- id: get-github-ref-name
|
- id: get-github-ref-name
|
||||||
run: echo "::set-output name=github-ref-name::${{ github.head_ref || github.ref_name }}"
|
run: echo "github-ref-name=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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 }}
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
- 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 "github-repository-owner-part=$(echo $GITHUB_REPOSITORY | cut -d/ -f1)" >> "$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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 }}
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
- 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 "github-repository-name-part=$(echo $GITHUB_REPOSITORY | cut -d/ -f2)" >> "$GITHUB_OUTPUT"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.3.2
|
- uses: rlespinasse/slugify-value@v1.3.3
|
||||||
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 }}
|
||||||
@@ -86,13 +86,13 @@ runs:
|
|||||||
slug-maxlength: ${{ inputs.slug-maxlength }}
|
slug-maxlength: ${{ inputs.slug-maxlength }}
|
||||||
|
|
||||||
# Short
|
# Short
|
||||||
- uses: rlespinasse/shortify-git-revision@v1.4.0
|
- uses: rlespinasse/shortify-git-revision@v1.5.1
|
||||||
with:
|
with:
|
||||||
name: GITHUB_SHA
|
name: GITHUB_SHA
|
||||||
short-on-error: true
|
short-on-error: true
|
||||||
length: ${{ steps.prefligth.outputs.PREFLIGHT_SHORT_LENGTH }}
|
length: ${{ steps.prefligth.outputs.PREFLIGHT_SHORT_LENGTH }}
|
||||||
prefix: ${{ inputs.prefix }}
|
prefix: ${{ inputs.prefix }}
|
||||||
- uses: rlespinasse/shortify-git-revision@v1.4.0
|
- uses: rlespinasse/shortify-git-revision@v1.5.1
|
||||||
with:
|
with:
|
||||||
name: GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
|
name: GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
|
||||||
revision: ${{ github.event.pull_request.head.sha }}
|
revision: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "::debug ::Set PREFLIGHT_SHORT_LENGTH=$PREFLIGHT_SHORT_LENGTH"
|
echo "::debug ::Set PREFLIGHT_SHORT_LENGTH=$PREFLIGHT_SHORT_LENGTH"
|
||||||
echo "::set-output name=PREFLIGHT_SHORT_LENGTH::$PREFLIGHT_SHORT_LENGTH"
|
echo "PREFLIGHT_SHORT_LENGTH=$PREFLIGHT_SHORT_LENGTH" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
Reference in New Issue
Block a user