-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(GITHUB_REF_NAME): use the github default variable instead
- Loading branch information
1 parent
aa95092
commit 67d56e0
Showing
2 changed files
with
37 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
name: "[v4] Test and Release" | ||
on: [push, pull_request] | ||
jobs: | ||
print-datasource: | ||
name: "Print Datasource" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Print datasource | ||
run: | | ||
echo "github.repository : ${{ github.repository }}" | ||
echo "GITHUB_REF : $GITHUB_REF" | ||
echo "GITHUB_HEAD_REF : $GITHUB_HEAD_REF" | ||
echo "GITHUB_BASE_REF : $GITHUB_BASE_REF" | ||
echo "GITHUB_REF_NAME : $GITHUB_REF_NAME" | ||
echo "github.event.ref : ${{ github.event.ref }}" | ||
echo "GITHUB_SHA : $GITHUB_SHA" | ||
echo "GITHUB_EVENT_PULL_REQUEST_HEAD_SHA : ${{ github.event.pull_request.head.sha }}" | ||
check-v3compatibility: | ||
name: "Check v3 compatibility" | ||
strategy: | ||
|
@@ -11,14 +30,16 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Load using v4.x with prefix | ||
uses: ./ | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Validate // Partial variables | ||
run: | | ||
[[ "${{ env.GITHUB_REPOSITORY_OWNER_PART }}" == "${{ env.V4_GITHUB_REPOSITORY_OWNER_PART }}" ]] | ||
|
@@ -96,14 +117,16 @@ jobs: | |
with: | ||
path: this-action | ||
ref: ${{ github.ref }} | ||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Load using v4.x with prefix | ||
uses: ./this-action | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Validate // Short SHA variables | ||
run: | | ||
[[ "${{ env.GITHUB_SHA_SHORT }}" == "${{ env.V4_GITHUB_SHA_SHORT }}" ]] | ||
|
@@ -120,6 +143,7 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load using v4.x | ||
uses: ./ | ||
|
||
|
@@ -200,14 +224,16 @@ jobs: | |
with: | ||
path: this-action | ||
ref: ${{ github.ref }} | ||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Load using v4.x with prefix | ||
uses: ./this-action | ||
with: | ||
prefix: V4_ | ||
short-length: 8 | ||
|
||
- name: Load using v3.x | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Short SHA variables | ||
run: | | ||
echo "sha : ${{ env.GITHUB_SHA_SHORT }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,11 @@ runs: | |
key: GITHUB_BASE_REF | ||
prefix: ${{ inputs.prefix }} | ||
slug-maxlength: ${{ inputs.slug-maxlength }} | ||
- uses: rlespinasse/[email protected] | ||
with: | ||
key: GITHUB_REF_NAME | ||
prefix: ${{ inputs.prefix }} | ||
slug-maxlength: ${{ inputs.slug-maxlength }} | ||
|
||
# Specific values | ||
- uses: rlespinasse/[email protected] | ||
|
@@ -57,15 +62,6 @@ runs: | |
slug-maxlength: ${{ inputs.slug-maxlength }} | ||
|
||
# Calculated values | ||
- id: get-github-ref-name | ||
run: echo "::set-output name=github-ref-name::$(echo "${{ github.head_ref || github.ref }}" | cut -d/ -f3)" | ||
shell: bash | ||
- uses: rlespinasse/[email protected] | ||
with: | ||
key: GITHUB_REF_NAME | ||
value: ${{ steps.get-github-ref-name.outputs.github-ref-name }} | ||
prefix: ${{ inputs.prefix }} | ||
slug-maxlength: ${{ inputs.slug-maxlength }} | ||
- id: get-github-repository-owner-part | ||
run: echo "::set-output name=github-repository-owner-part::$(echo $GITHUB_REPOSITORY | cut -d/ -f1)" | ||
shell: bash | ||
|