mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Fix function list parsing to skip header rows
Use grep to only match lines starting with lowercase (function names), and add validation to skip empty or invalid names. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ae776d921
commit
f88ee513d4
1 file changed
+6
-2
@@ -81,14 +81,18 @@ jobs:
|
||||
|
||||
- name: Remove Deleted Functions
|
||||
run: |
|
||||
# Get list of functions deployed on Supabase
|
||||
deployed=$(supabase functions list --project-ref $SUPABASE_PROJECT_REF | tail -n +2 | awk '{print $1}')
|
||||
# Get list of functions deployed on Supabase (skip header lines, extract slug column)
|
||||
deployed=$(supabase functions list --project-ref $SUPABASE_PROJECT_REF | grep -E '^[a-z]' | awk '{print $1}')
|
||||
|
||||
# Get list of functions in the repo (excluding _shared)
|
||||
local_functions=$(ls -d apps/supabase/functions/*/ 2>/dev/null | xargs -I {} basename {} | grep -v '^_shared$' || true)
|
||||
|
||||
# Delete any deployed functions that no longer exist in the repo
|
||||
for func in $deployed; do
|
||||
# Skip empty or invalid function names
|
||||
[ -z "$func" ] && continue
|
||||
[[ "$func" =~ ^[^a-z] ]] && continue
|
||||
|
||||
if ! echo "$local_functions" | grep -q "^${func}$"; then
|
||||
echo "Deleting removed function: $func"
|
||||
supabase functions delete "$func" --project-ref $SUPABASE_PROJECT_REF
|
||||
|
||||
Reference in new issue
Block a user