ohmyapi Claude Opus 4.6 (1M context) commited on
Commit
35efd6e
·
1 Parent(s): bb0e8fb

fix: CI auto-import reads from zip (staging dir cleaned by bundle_output)

Browse files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

.github/workflows/register-outlook.yml CHANGED
@@ -75,20 +75,20 @@ jobs:
75
  echo "OUTLOOK2API_URL or ADMIN_PASSWORD not set, skipping import"
76
  exit 0
77
  fi
78
- # Extract accounts from staging files
79
- ACCOUNTS="[]"
80
- if [ -d "output/.staging_outlook" ]; then
81
- ACCOUNTS=$(python -c "
82
- import json, glob
83
  accs = []
84
- for f in glob.glob('output/.staging_outlook/outlook_*.json'):
85
  try:
86
- d = json.load(open(f))
87
- accs.append(f\"{d['email']}:{d['password']}\")
 
 
 
88
  except: pass
89
  print(json.dumps(accs))
90
  ")
91
- fi
92
  if [ "$ACCOUNTS" = "[]" ]; then
93
  echo "No accounts to import"
94
  exit 0
 
75
  echo "OUTLOOK2API_URL or ADMIN_PASSWORD not set, skipping import"
76
  exit 0
77
  fi
78
+ # Extract accounts from the generated zip file
79
+ ACCOUNTS=$(python -c "
80
+ import json, glob, zipfile
 
 
81
  accs = []
82
+ for zf in glob.glob('output/*Outlook.zip'):
83
  try:
84
+ with zipfile.ZipFile(zf) as z:
85
+ data = z.read('accounts.txt').decode().strip()
86
+ for line in data.splitlines():
87
+ if ':' in line:
88
+ accs.append(line.strip())
89
  except: pass
90
  print(json.dumps(accs))
91
  ")
 
92
  if [ "$ACCOUNTS" = "[]" ]; then
93
  echo "No accounts to import"
94
  exit 0