From 2c5a6278614844fde520a26c2b4d2f0ff93211bb Mon Sep 17 00:00:00 2001 From: rlespinasse Date: Sat, 9 Apr 2022 22:26:32 +0200 Subject: [PATCH] fix(GITHUB_REF_NAME): correctly fill the variable on pull request events --- .github/workflows/v4-tests-and-release.yml | 19 +++++++++++++------ action.yml | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/v4-tests-and-release.yml b/.github/workflows/v4-tests-and-release.yml index a63a5bf..402460e 100644 --- a/.github/workflows/v4-tests-and-release.yml +++ b/.github/workflows/v4-tests-and-release.yml @@ -11,14 +11,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Load using v3.x - uses: rlespinasse/github-slug-action@v3.x + - name: Load using v4.x with prefix uses: ./ with: prefix: V4_ short-length: 8 + - name: Load using v3.x + uses: rlespinasse/github-slug-action@v3.x + - name: Validate // Partial variables run: | [[ "${{ env.GITHUB_REPOSITORY_OWNER_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART }}" ]] @@ -96,14 +98,16 @@ jobs: with: path: this-action ref: ${{ github.ref }} - - name: Load using v3.x - uses: rlespinasse/github-slug-action@v3.x + - name: Load using v4.x with prefix uses: ./this-action with: prefix: V4_ short-length: 8 + - name: Load using v3.x + uses: rlespinasse/github-slug-action@v3.x + - name: Validate // Short SHA variables run: | [[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]] @@ -120,6 +124,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Load using v4.x uses: ./ @@ -200,14 +205,16 @@ jobs: with: path: this-action ref: ${{ github.ref }} - - name: Load using v3.x - uses: rlespinasse/github-slug-action@v3.x + - name: Load using v4.x with prefix uses: ./this-action with: prefix: V4_ short-length: 8 + - name: Load using v3.x + uses: rlespinasse/github-slug-action@v3.x + - name: Short SHA variables run: | echo "sha : ${{ env.GITHUB_SHA_SHORT }}" diff --git a/action.yml b/action.yml index 4e0dcef..1921095 100644 --- a/action.yml +++ b/action.yml @@ -58,7 +58,7 @@ runs: # Calculated values - 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 - uses: rlespinasse/slugify-value@v1.2.3 with: