forked from zakarm/ft_transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.65 KB
/
Check.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
52
53
54
55
56
57
name: TypeScript and Prettier Check
on: [push, pull_request]
jobs:
typescript-prettier-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
cd app/front-end/
npm install
- name: Run TypeScript Check
run: |
cd app/front-end/
npm run tsc --noEmit
typescript_exit_code=$?
if [ $typescript_exit_code -ne 0 ]; then
echo "TypeScript check failed. Aborting workflow."
exit $typescript_exit_code
else
echo "TypeScript check passed."
fi
# - name: Run Prettier Check
# run: |
# cd app/front-end/
# npm run check || npm run format
# prettier_exit_code=$?
# if [ $prettier_exit_code -ne 0 ]; then
# echo "Prettier check failed. Proceeding to commit changes."
# else
# echo "Prettier check passed. No further action needed."
# exit 0 # Exit successfully if Prettier check passed
# fi
# - name: Commit and Push Changes
# if: ${{ success() }}
# run: |
# git config --global user.email "[email protected]"
# git config --global user.name "ael-mouz"
# git checkout -B ${{ github.ref_name }}
# git add .
# git commit -m "[Style] Prettier fixes"
# git push origin HEAD:${{ github.ref_name }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}