-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.64 KB
/
react.yml
File metadata and controls
65 lines (56 loc) · 1.64 KB
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
58
59
60
61
62
63
64
65
name: React CI
on:
push:
branches: [ main ]
paths:
- 'Frontend/**'
- '.github/workflows/react.yml'
pull_request:
paths:
- 'Frontend/**'
- '.github/workflows/react.yml'
workflow_dispatch:
defaults:
run:
working-directory: Frontend
jobs:
lint-build:
name: Lint Auto-fix, Build and Update Dependencies
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ESLint with auto-fix
run: pnpm run lint:fix
- name: Build project
run: pnpm run build
- name: Check for file changes
id: git-check
working-directory: .
run: |
if git diff --exit-code; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request with lint fixes
if: steps.git-check.outputs.changed == 'true' && github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore(frontend): fix lint issues & update dependencies"
title: "chore(frontend): fix lint issues & update dependencies"
body: "The `ESLint` action wants to apply these fixes & updates."
branch: "chore/es-lint-fixes"
base: main
signoff: true
sign-commits: true