generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1019 Bytes
/
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
name: "main"
on:
pull_request:
push:
branches:
- v2
jobs:
dist:
name: Verify committed dist directory
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Calculate hash of committed `dist` directory
run: echo "COMMITTED_HASH=${{ hashFiles('./dist/**') }}" >> $GITHUB_ENV
- run: yarn install
- name: Calculate expected hash of `dist` directory
run: |
rm -rf dist && yarn run prepare
echo "EXPECTED_HASH=${{ hashFiles('./dist/**') }}" >> $GITHUB_ENV
- name: Compare committed and expected hashes
run: |
echo "COMMITTED_HASH: ${{ env.COMMITTED_HASH }}"
echo "EXPECTED_HASH: ${{ env.EXPECTED_HASH }}"
export RESULT=$(expr "${{ env.COMMITTED_HASH }}" != "${{ env.EXPECTED_HASH }}")
echo "RESULT: $RESULT"
exit $RESULT
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn install
- run: yarn run lint