-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.36 KB
/
pull_request_to_main.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
51
name: pull request to main
on:
pull_request
jobs:
cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
node_modules
key: node-${{ hashFiles('**/package-lock.json') }}'
- run: npm ci
if: steps.cache.outputs.cache-hit != 'true'
check-version:
needs: cache
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Check package version
id: cpv
uses: PostHog/check-package-version@v2
with:
path: ./libs/stripe
- name: Echo output
run: |
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}"
echo "Published version: ${{ steps.cpv.outputs.published-version }}"
- name: Failure Check Version
if: steps.cpv.outputs.is-new-version != 'true'
run: |
echo "Version Failed"
exit: 1
- name: Install dependencies
if: steps.cpv.outputs.is-new-version == 'true'
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
node_modules
key: node-${{ hashFiles('**/package-lock.json') }}'
- run: npm ci
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run build