-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_github.sh
More file actions
executable file
·106 lines (94 loc) · 3.49 KB
/
Copy pathsetup_github.sh
File metadata and controls
executable file
·106 lines (94 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env bash
#
# setup_github.sh — initialize this folder as a git repo and push it to GitHub.
#
# WHAT THIS DOES:
# 1. Safety-checks for files that should never be public (.db, .env, real data)
# 2. git init + first commit
# 3. wires up the GitHub remote and pushes
#
# WHAT IT DOES NOT DO:
# It does not store or handle your GitHub password/token. When git asks you to
# authenticate during the push, that happens directly between your machine and
# GitHub — this script never sees it.
#
# BEFORE YOU RUN:
# 1. Create an EMPTY repo on github.com named "careask"
# (do NOT add a README, .gitignore, or license there — you already have them)
# 2. Run this script from inside the careask folder:
# bash setup_github.sh
#
set -e
REPO_NAME="careask"
GITHUB_USER="bbiddick7"
REMOTE_URL="https://github.com/${GITHUB_USER}/${REPO_NAME}.git"
echo "==> CareAsk GitHub setup"
echo
# --- 1. Safety check: refuse to proceed if sensitive files are present ---
echo "==> Checking for files that should never be committed..."
PROBLEM=0
if ls db/*.db >/dev/null 2>&1; then
echo " ! Found a .db file in db/ — this is gitignored, but confirming it won't be tracked."
fi
if [ -f .env ]; then
echo " ! Found a .env file. It is gitignored, but double-check it holds no real secrets you don't want backed up."
fi
# Look for anything that smells like real data outside the synthetic generator.
if grep -rliE "ssn|social security|medicaid id|real_patient|phi" --include=*.csv --include=*.json . 2>/dev/null | grep -v node_modules; then
echo " !! Potential real-data file detected above. STOP and review before pushing."
PROBLEM=1
fi
if [ "$PROBLEM" -eq 1 ]; then
echo
echo "Aborting. Remove or review the flagged files, then re-run."
exit 1
fi
echo " ok — nothing obviously sensitive detected."
echo
# --- 2. Confirm git identity ---
if ! git config user.name >/dev/null 2>&1; then
echo "==> Git needs your identity. Setting it now."
read -rp " Your name: " GIT_NAME
read -rp " Your GitHub email: " GIT_EMAIL
git config --global user.name "$GIT_NAME"
git config --global user.email "$GIT_EMAIL"
fi
# --- 3. Init + commit ---
if [ -d .git ]; then
echo "==> This folder is already a git repo; skipping init."
else
echo "==> Initializing git repo..."
git init
fi
echo "==> Staging files..."
git add .
echo
echo "==> These files will be committed:"
git status --short
echo
read -rp "Look right? Press ENTER to commit, or Ctrl-C to stop and review: " _
git commit -m "Initial commit: CareAsk PHI-safe NL-to-SQL reference architecture" || {
echo "Nothing to commit (already committed?). Continuing."
}
# --- 4. Wire remote + push ---
git branch -M main
if git remote get-url origin >/dev/null 2>&1; then
echo "==> Remote 'origin' already set to: $(git remote get-url origin)"
else
echo "==> Adding remote: ${REMOTE_URL}"
git remote add origin "${REMOTE_URL}"
fi
echo
echo "==> Pushing to GitHub. You'll be asked to authenticate."
echo " Username: ${GITHUB_USER}"
echo " Password: paste your Personal Access Token (NOT your account password)."
echo " (If you don't have a token yet, press Ctrl-C and create one first:"
echo " GitHub → Settings → Developer settings → Personal access tokens.)"
echo
git push -u origin main
echo
echo "==> Done. Your repo should be live at:"
echo " https://github.com/${GITHUB_USER}/${REPO_NAME}"
echo
echo "Next: add topics (healthcare, hipaa, llm, python, nlp-to-sql) and"
echo "confirm the About description matches your LinkedIn project entry."