|
6 | 6 | - '*' |
7 | 7 | branches: |
8 | 8 | - main |
| 9 | + pull_request_review: |
9 | 10 | pull_request_target: |
10 | 11 | pull_request: |
11 | 12 | branches: |
@@ -41,22 +42,22 @@ jobs: |
41 | 42 | echo "Is Tag: ${{ steps.branch-name.outputs.is_tag }}" |
42 | 43 | echo "Current tag: ${{ steps.branch-name.outputs.tag }}" |
43 | 44 | - name: Test is_default output for pull request |
44 | | - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'false' |
| 45 | + if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'false' |
45 | 46 | run: | |
46 | 47 | echo "Is default is invalid: ${{ steps.branch-name.outputs.is_default }}" |
47 | 48 | exit 1 |
48 | 49 | - name: Test is_default output for non pull request |
49 | | - if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target' && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'true' |
| 50 | + if: "!contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && steps.branch-name.outputs.is_default != 'true'" |
50 | 51 | run: | |
51 | 52 | echo "Is default is invalid: ${{ steps.branch-name.outputs.is_default }}" |
52 | 53 | exit 1 |
53 | 54 | - name: Test base_ref_branch output |
54 | | - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.base_ref_branch |
| 55 | + if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.base_ref_branch |
55 | 56 | run: | |
56 | 57 | echo "Base ref unset: ${{ steps.branch-name.outputs.base_ref_branch }}" |
57 | 58 | exit 1 |
58 | 59 | - name: Test head_ref output |
59 | | - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.head_ref_branch |
| 60 | + if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.head_ref_branch |
60 | 61 | run: | |
61 | 62 | echo "Head ref unset: ${{ steps.branch-name.outputs.head_ref_branch }}" |
62 | 63 | exit 1 |
|
66 | 67 | echo "Ref unset: ${{ steps.branch-name.outputs.ref_branch }}" |
67 | 68 | exit 1 |
68 | 69 | - name: Test current_branch output for pull_request or pull_request_target event. |
69 | | - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.current_branch |
| 70 | + if: contains(github.event_name, 'pull_request') && steps.branch-name.outputs.is_tag == 'false' && !steps.branch-name.outputs.current_branch |
70 | 71 | run: | |
71 | 72 | echo "Current branch unset: ${{ steps.branch-name.outputs.current_branch }}" |
72 | 73 | exit 1 |
|
0 commit comments