File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,23 @@ jobs:
27
27
- name : Install dependencies
28
28
run : npm ci
29
29
30
+ - name : Determine base branch
31
+ id : vars
32
+ run : |
33
+ if [[ "${{ github.event_name }}" == "pull_request" ]]; then
34
+ echo "BASE_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
35
+ else
36
+ echo "BASE_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
37
+ fi
38
+
39
+ - name : Fetch base branch
40
+ run : |
41
+ git fetch origin $BASE_BRANCH
42
+
30
43
- name : Get list of changed files
31
44
id : files
32
45
run : |
33
- echo "CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref || github.ref_name }} | tr '\n' ' ')" >> $GITHUB_ENV
46
+ echo "CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT origin/$BASE_BRANCH | tr '\n' ' ')" >> $GITHUB_ENV
34
47
35
48
- name : Lint JS/TS files with ESLint (no auto-fix)
36
49
if : ${{ env.CHANGED_FILES != ''}}
44
57
echo "No JS/TS files to lint."
45
58
fi
46
59
47
- - name : Format other files with Prettier
60
+ - name : Format other files with Prettier (no auto-fix)
48
61
if : ${{ env.CHANGED_FILES != ''}}
49
62
run : |
50
63
FILES=$(echo "$CHANGED_FILES" | tr ' ' '\n' | grep -E '\.(json|md|css|scss|html)$' | xargs)
55
68
else
56
69
echo "No files to format with Prettier."
57
70
fi
58
-
59
- - name : Type Check
60
- run : |
61
- echo "Running TypeScript type checking..."
62
- npx tsc --noEmit
63
71
64
72
type-check :
65
73
name : Type Checking
You can’t perform that action at this time.
0 commit comments