File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 "enableGlobDot" : true ,
44 "useGitignore" : true ,
55 "gitignoreRoot" : " ." ,
6- "ignorePaths" : [" LICENSE" ],
6+ "ignorePaths" : [" LICENSE" , " local.env " ],
77 "words" : [
88 " csharpierignore" ,
99 " csharpierrc" ,
Original file line number Diff line number Diff line change 44!**/.devcontainer/**
55!.config/
66!**/.config/**
7+ local.env
78
89node_modules/
910
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ services:
22 devcontainer :
33 env_file :
44 - .env
5+ - path : local.env
6+ required : false
57 build :
68 context : .
79 dockerfile : Dockerfile
Original file line number Diff line number Diff line change 99 "lint" : " pnpm node scripts/lint.ts" ,
1010 "node" : " vite-node scripts/node.ts" ,
1111 "publish" : " pnpm node scripts/publish.ts" ,
12+ "push" : " pnpm node scripts/push.ts" ,
1213 "restore" : " pnpm node scripts/restore.ts" ,
1314 "test" : " pnpm node scripts/test.ts" ,
1415 "update" : " pnpm node scripts/update.ts"
Original file line number Diff line number Diff line change 1+ import fs from "node:fs" ;
2+
3+ import git from "isomorphic-git" ;
4+ import http from "isomorphic-git/http/node" ;
5+
6+ import { projectRoot } from "@/scripts/project.js" ;
7+
8+ const currentBranch = await git . currentBranch ( { fs, dir : projectRoot , fullname : false } ) ;
9+ if ( ! currentBranch ) throw new Error ( "Failed to determine current branch" ) ;
10+
11+ const remote = ( await git . listRemotes ( { fs, dir : projectRoot } ) ) . at ( 0 ) ;
12+ if ( remote === undefined ) {
13+ throw new Error ( "Git remote not found" ) ;
14+ }
15+ const token = process . env . GIT_REMOTE_TOKEN ;
16+ if ( ! token ) throw new Error ( "GIT_REMOTE_TOKEN environment variable is not set" ) ;
17+
18+ await git . push ( {
19+ fs,
20+ http,
21+ dir : projectRoot ,
22+ remote : remote . remote ,
23+ ref : currentBranch ,
24+ force : true ,
25+ onAuth : ( ) => ( {
26+ username : "git" ,
27+ password : token ,
28+ } ) ,
29+ } ) ;
You can’t perform that action at this time.
0 commit comments