File tree Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Expand file tree Collapse file tree 2 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 43
43
44
44
- name : Check if repository is dirty
45
45
shell : bash
46
- env :
47
- EXCLUDE : ${{ inputs.platform == 'android' && 'ios' || 'android' }}
48
46
run : |
49
- if [[ -n "$(git status --porcelain | grep -v ". $EXCLUDE" | grep -v example/ios/Podfile.lock)" ]]; then
50
- >&2 echo "Found unexpected changes in repository after generating"
51
- git status --short
52
- git diff
53
- exit 1
54
- fi
47
+ bash contrib/scripts/check-dirty.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -exuo pipefail
4
+
5
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
6
+ ROOT_DIR=" ${SCRIPT_DIR} /../.."
7
+
8
+ # Collect changed files (excluding lines matching $EXCLUDE and the Podfile.lock)
9
+ CHANGED_FILES=" $( git status --porcelain | grep -v example/ios/Podfile.lock | awk ' {print $2}' ) "
10
+
11
+ # If there are changes, show details and file contents
12
+ if [[ -n " $CHANGED_FILES " ]]; then
13
+ >&2 echo " Found unexpected changes in repository after generating"
14
+ git status --short
15
+ git --no-pager diff
16
+
17
+ for file in $CHANGED_FILES ; do
18
+ full_path=" ${ROOT_DIR} /$file "
19
+
20
+ # Skip directories
21
+ if [ -d " $full_path " ]; then
22
+ echo " Skipping directory: $file "
23
+ continue
24
+ fi
25
+
26
+ echo " -------------------------"
27
+ echo " Full content of $file :"
28
+ echo " -------------------------"
29
+ cat " $full_path "
30
+ echo
31
+ done
32
+
33
+ exit 1
34
+ fi
You can’t perform that action at this time.
0 commit comments