-
Notifications
You must be signed in to change notification settings - Fork 258
46 lines (39 loc) · 1.21 KB
/
push-build.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
name: Compile TS
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Install dependencies
run: yarn install
- name: Compile TS
run: yarn build
- name: Setup Git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "Rapid Stream Bot"
git config --global credential.helper store
echo "https://${{ secrets.USERNAME }}:${{ secrets.TOKEN }}@github.com" > ~/.git-credentials
shell: bash
- name: Check Diff
id: check_diff
run: |
git diff --exit-code
if [ $? -eq 0 ]
then
echo "push_changes=false" >> $GITHUB_OUTPUT
else
echo "push_changes=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Push Changes
if: steps.check_diff.outputs.push_changes == 'true'
run: |
git add .
git commit -am "Compile TS"
git push