mirror of
https://github.com/rlespinasse/github-slug-action.git
synced 2026-06-14 02:21:06 +00:00
fix(GITHUB_REF_NAME): correctly fill the variable on pull request events
This commit is contained in:
committed by
Romain Lespinasse
parent
aa95092e35
commit
2c5a627861
19
.github/workflows/v4-tests-and-release.yml
vendored
19
.github/workflows/v4-tests-and-release.yml
vendored
@@ -11,14 +11,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Load using v3.x
|
|
||||||
uses: rlespinasse/github-slug-action@v3.x
|
|
||||||
- name: Load using v4.x with prefix
|
- name: Load using v4.x with prefix
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
prefix: V4_
|
prefix: V4_
|
||||||
short-length: 8
|
short-length: 8
|
||||||
|
|
||||||
|
- name: Load using v3.x
|
||||||
|
uses: rlespinasse/github-slug-action@v3.x
|
||||||
|
|
||||||
- name: Validate // Partial variables
|
- name: Validate // Partial variables
|
||||||
run: |
|
run: |
|
||||||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART }}" ]]
|
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART }}" ]]
|
||||||
@@ -96,14 +98,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: this-action
|
path: this-action
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
- name: Load using v3.x
|
|
||||||
uses: rlespinasse/github-slug-action@v3.x
|
|
||||||
- name: Load using v4.x with prefix
|
- name: Load using v4.x with prefix
|
||||||
uses: ./this-action
|
uses: ./this-action
|
||||||
with:
|
with:
|
||||||
prefix: V4_
|
prefix: V4_
|
||||||
short-length: 8
|
short-length: 8
|
||||||
|
|
||||||
|
- name: Load using v3.x
|
||||||
|
uses: rlespinasse/github-slug-action@v3.x
|
||||||
|
|
||||||
- name: Validate // Short SHA variables
|
- name: Validate // Short SHA variables
|
||||||
run: |
|
run: |
|
||||||
[[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]]
|
[[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]]
|
||||||
@@ -120,6 +124,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Load using v4.x
|
- name: Load using v4.x
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|
||||||
@@ -200,14 +205,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: this-action
|
path: this-action
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
- name: Load using v3.x
|
|
||||||
uses: rlespinasse/github-slug-action@v3.x
|
|
||||||
- name: Load using v4.x with prefix
|
- name: Load using v4.x with prefix
|
||||||
uses: ./this-action
|
uses: ./this-action
|
||||||
with:
|
with:
|
||||||
prefix: V4_
|
prefix: V4_
|
||||||
short-length: 8
|
short-length: 8
|
||||||
|
|
||||||
|
- name: Load using v3.x
|
||||||
|
uses: rlespinasse/github-slug-action@v3.x
|
||||||
|
|
||||||
- name: Short SHA variables
|
- name: Short SHA variables
|
||||||
run: |
|
run: |
|
||||||
echo "sha : ${{ env.GITHUB_SHA_SHORT }}"
|
echo "sha : ${{ env.GITHUB_SHA_SHORT }}"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ runs:
|
|||||||
|
|
||||||
# Calculated values
|
# Calculated values
|
||||||
- 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::${{ github.head_ref || github.ref_name }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: rlespinasse/slugify-value@v1.2.3
|
- uses: rlespinasse/slugify-value@v1.2.3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user