Skip to content

Commit fd631fd

Browse files
authored
chore: update test.yml
1 parent b08a65c commit fd631fd

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
test:
17-
name: Test branch-name
17+
name: Test branch-names
1818
runs-on: ${{ matrix.platform }}
1919
strategy:
2020
fail-fast: false
@@ -29,60 +29,60 @@ jobs:
2929
GITHUB_CONTEXT: ${{ toJson(github) }}
3030
run: echo "$GITHUB_CONTEXT"
3131
- name: Run test
32-
id: branch-name
32+
id: branch-names
3333
uses: ./
3434
- name: Show output
3535
run: |
36-
echo "Default Branch: ${{ steps.branch-name.outputs.default_branch }}"
37-
echo "Current Branch: ${{ steps.branch-name.outputs.current_branch }}"
38-
echo "Base Ref: ${{ steps.branch-name.outputs.base_ref_branch }}"
39-
echo "Head Ref: ${{ steps.branch-name.outputs.head_ref_branch }}"
40-
echo "Ref: ${{ steps.branch-name.outputs.ref_branch }}"
41-
echo "Is Default: ${{ steps.branch-name.outputs.is_default }}"
42-
echo "Is Tag: ${{ steps.branch-name.outputs.is_tag }}"
43-
echo "Current tag: ${{ steps.branch-name.outputs.tag }}"
36+
echo "Default Branch: ${{ steps.branch-names.outputs.default_branch }}"
37+
echo "Current Branch: ${{ steps.branch-names.outputs.current_branch }}"
38+
echo "Base Ref: ${{ steps.branch-names.outputs.base_ref_branch }}"
39+
echo "Head Ref: ${{ steps.branch-names.outputs.head_ref_branch }}"
40+
echo "Ref: ${{ steps.branch-names.outputs.ref_branch }}"
41+
echo "Is Default: ${{ steps.branch-names.outputs.is_default }}"
42+
echo "Is Tag: ${{ steps.branch-names.outputs.is_tag }}"
43+
echo "Current tag: ${{ steps.branch-names.outputs.tag }}"
4444
- name: Test is_default output for pull request
45-
if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'false'
45+
if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && steps.branch-names.outputs.is_default != 'false'
4646
run: |
47-
echo "Is default is invalid: ${{ steps.branch-name.outputs.is_default }}"
47+
echo "Is default is invalid: ${{ steps.branch-names.outputs.is_default }}"
4848
exit 1
4949
- name: Test is_default output for non pull request
50-
if: "!contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'true'"
50+
if: "!contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && steps.branch-names.outputs.is_default != 'true'"
5151
run: |
52-
echo "Is default is invalid: ${{ steps.branch-name.outputs.is_default }}"
52+
echo "Is default is invalid: ${{ steps.branch-names.outputs.is_default }}"
5353
exit 1
5454
- name: Test base_ref_branch output
55-
if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.base_ref_branch
55+
if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.base_ref_branch
5656
run: |
57-
echo "Base ref unset: ${{ steps.branch-name.outputs.base_ref_branch }}"
57+
echo "Base ref unset: ${{ steps.branch-names.outputs.base_ref_branch }}"
5858
exit 1
5959
- name: Test head_ref output
60-
if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.head_ref_branch
60+
if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.head_ref_branch
6161
run: |
62-
echo "Head ref unset: ${{ steps.branch-name.outputs.head_ref_branch }}"
62+
echo "Head ref unset: ${{ steps.branch-names.outputs.head_ref_branch }}"
6363
exit 1
6464
- name: Test ref_branch output
65-
if: "!steps.branch-name.outputs.ref_branch && steps.branch-name.outputs.is_tag == 'false'"
65+
if: "!steps.branch-names.outputs.ref_branch && steps.branch-names.outputs.is_tag == 'false'"
6666
run: |
67-
echo "Ref unset: ${{ steps.branch-name.outputs.ref_branch }}"
67+
echo "Ref unset: ${{ steps.branch-names.outputs.ref_branch }}"
6868
exit 1
6969
- name: Test current_branch output for pull_request or pull_request_target event.
70-
if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.current_branch
70+
if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.current_branch
7171
run: |
72-
echo "Current branch unset: ${{ steps.branch-name.outputs.current_branch }}"
72+
echo "Current branch unset: ${{ steps.branch-names.outputs.current_branch }}"
7373
exit 1
7474
- name: Test current_branch output for push event.
75-
if: github.event_name == 'push' && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.current_branch
75+
if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.current_branch
7676
run: |
77-
echo "Current branch unset: ${{ steps.branch-name.outputs.current_branch }}"
77+
echo "Current branch unset: ${{ steps.branch-names.outputs.current_branch }}"
7878
exit 1
7979
- name: Test current_branch output for tag based push event.
80-
if: github.event_name == 'push' && steps.branch-name.outputs.is_tag == 'true' && !steps.branch-name.outputs.base_ref_branch
80+
if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'true' && !steps.branch-names.outputs.base_ref_branch
8181
run: |
82-
echo "Base ref unset: ${{ steps.branch-name.outputs.base_ref_branch }}"
82+
echo "Base ref unset: ${{ steps.branch-names.outputs.base_ref_branch }}"
8383
exit 1
8484
- name: Test tag output for tag based push event.
85-
if: github.event_name == 'push' && steps.branch-name.outputs.is_tag == 'true' && !steps.branch-name.outputs.tag
85+
if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'true' && !steps.branch-names.outputs.tag
8686
run: |
87-
echo "Current tag unset: ${{ steps.branch-name.outputs.tag }}"
87+
echo "Current tag unset: ${{ steps.branch-names.outputs.tag }}"
8888
exit 1

0 commit comments

Comments
 (0)