-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (38 loc) · 1.04 KB
/
test.yaml
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
---
name: "Test"
on:
pull_request:
branches:
- main
jobs:
test: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/setup-node@v3
with:
node-version: "16"
- run: |
yarn
- run: |
yarn all
- name: Check for diff
id: diff
run: |
if git status -s dist/ | grep "dist/"; then
echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT"
else
echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT"
fi
- name: Push build
if: ${{ steps.diff.outputs.SHOULD_PUSH_BUILD == 'true' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add dist/*
git commit -m "chore: Build Source"
git push