-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-to-github.sh
More file actions
executable file
·62 lines (50 loc) · 1.82 KB
/
Copy pathpush-to-github.sh
File metadata and controls
executable file
·62 lines (50 loc) · 1.82 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
#!/bin/bash
# Push agent-rollback to GitHub
# Usage: ./push-to-github.sh <github-username> <github-token>
set -e
if [ $# -lt 2 ]; then
echo "Usage: $0 <github-username> <github-token>"
echo "Example: $0 johndoe ghp_xxxxxxxxxxxxxxxxxxxx"
exit 1
fi
USERNAME="$1"
TOKEN="$2"
REPO_NAME="agent-rollback"
# Replace YOUR_USERNAME in source files
sed -i "s/YOUR_USERNAME/${USERNAME}/g" go.mod
sed -i "s/YOUR_USERNAME/${USERNAME}/g" cmd/agent-rollback/main.go
sed -i "s/YOUR_USERNAME/${USERNAME}/g" README.md
echo "Module path updated to github.com/${USERNAME}/${REPO_NAME}"
# Verify build
echo "Verifying build..."
go mod tidy
go build ./...
go test ./rollback/ -v
echo "Build and tests passed."
# Create GitHub repo via API
echo "Creating GitHub repository..."
curl -s -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/repos \
-d "{\"name\":\"${REPO_NAME}\",\"private\":false,\"description\":\"Golang native agent rollback - the undo button for AI agent workspaces\"}" \
| python3 -c "import sys,json; d=json.load(sys.stdin); print('Repo URL:', d.get('html_url', d.get('message','unknown')))"
# Initialize git and push
echo "Initializing git and pushing..."
git init
git add .
git commit -m "Initial commit: Golang native agent-rollback package
Features:
- Content-addressed storage (SHA-256 dedup)
- Git-aware workspace scanning
- Checkpoint create/list/show/diff/restore/undo
- Pin & prune with garbage collection
- Selective operation revert
- Append-only operation log
- Unified diff (LCS algorithm)
- 100% local, no telemetry"
git branch -M main
git remote add origin "https://${USERNAME}:${TOKEN}@github.com/${USERNAME}/${REPO_NAME}.git"
git push -u origin main
echo ""
echo "Done! Repository pushed to: https://github.com/${USERNAME}/${REPO_NAME}"