-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.49 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Package
on:
pull_request:
pull_request_target:
types:
- closed
# push:
# branches:
# - main
jobs:
publish:
runs-on: ubuntu-latest
name: Hello Everyone
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Environment Variables
run: |
ref=$(git branch -r --contains ${{ github.sha }})
branch=${ref##*/}
echo -ne "GITHUB_BRANCH=$branch" >> $GITHUB_ENV
- name: test 1
run: |
echo ${{ github.event.pull_request.merged }}
echo ${{ github.event.pull_request.closed }}
echo ${{ github.event.push }}
echo ${{ github.head_ref }}
echo ${{ github.ref }}
echo ${{ github.ref_name }}
- name: test 2
run: |
echo ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && 'production' || 'staging' }}
echo ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && 'yarn package' || 'yarn package --tag beta' }}
- name: test 3
run: |
echo ${{ env.MATT_ENV }}
echo ${{ env.PACKAGE_TAG }}
echo ${{ env.GITHUB_BRANCH }}
env:
MATT_ENV: ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && 'production' || 'staging' }}
PACKAGE_TAG: ${{ (github.event.pull_request.merged == true && github.ref_name == 'main') && '' || '--tag beta' }}