@@ -71,31 +71,33 @@ jobs:
71
71
return 0
72
72
}
73
73
74
- # Process each SQL file
74
+ # Find the manifest.toml once at the start
75
+ MANIFEST_PATH=""
75
76
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
76
- echo "Processing $file"
77
-
78
- # Find and parse manifest.toml
79
77
DIR_PATH=$(dirname "$file")
80
- MANIFEST_PATH=""
81
78
while [[ "$DIR_PATH" == export* ]]; do
82
79
if [[ -f "$DIR_PATH/manifest.toml" ]]; then
83
80
MANIFEST_PATH="$DIR_PATH/manifest.toml"
84
- break
81
+ break 2 # Break out of both loops once found
85
82
fi
86
83
DIR_PATH=$(dirname "$DIR_PATH")
87
84
done
88
-
89
- if [[ -z "$MANIFEST_PATH" ]]; then
90
- echo "Error: No manifest.toml found for $file"
91
- exit 1
92
- fi
93
-
94
- # Parse manifest.toml
95
- PROJECT=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['project'])")
96
- INSTANCE=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['instance'])")
97
- DATABASE=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['database'])")
98
- FORMAT=$(python3 -c "import toml; config=toml.load('$MANIFEST_PATH'); print(config.get('format', 'JSON'))")
85
+ done
86
+
87
+ if [[ -z "$MANIFEST_PATH" ]]; then
88
+ echo "Error: No manifest.toml found in the export directory"
89
+ exit 1
90
+ fi
91
+
92
+ # Parse manifest.toml once
93
+ PROJECT=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['project'])")
94
+ INSTANCE=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['instance'])")
95
+ DATABASE=$(python3 -c "import toml; print(toml.load('$MANIFEST_PATH')['database'])")
96
+ FORMAT=$(python3 -c "import toml; config=toml.load('$MANIFEST_PATH'); print(config.get('format', 'JSON'))")
97
+
98
+ # Process each SQL file
99
+ for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
100
+ echo "Processing $file"
99
101
100
102
# Read SQL content and encode to base64
101
103
SQL_CONTENT=$(base64 < "$file")
0 commit comments