File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 7777 "purge-old-workflow-runs" : " tsx src/workflows/purge-old-workflow-runs.js" ,
7878 "ready-for-docs-review" : " tsx src/workflows/ready-for-docs-review.ts" ,
7979 "release-banner" : " tsx src/ghes-releases/scripts/release-banner.ts" ,
80+ "repo-sync" : " ./src/workflows/local-repo-sync.sh" ,
8081 "reusables" : " tsx src/content-render/scripts/reusables-cli.ts" ,
8182 "rendered-content-link-checker" : " tsx src/links/scripts/rendered-content-link-checker.ts" ,
8283 "rendered-content-link-checker-cli" : " tsx src/links/scripts/rendered-content-link-checker-cli.ts" ,
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ echo " > This script assumes docs and docs-internal are cloned together in the same directory already."
6+
7+ echo " > Making sure the repos are a sibiling directories..."
8+ cd ../docs || (echo " Repo docs not found as a sibling directory" && exit 1)
9+ cd ../docs-internal || (echo " Repo docs-internal not found as a sibling directory" && exit 1)
10+ echo " > Found directories for repos docs and docs-internal"
11+
12+ echo " > Checking out main branch and updating both repositories..."
13+ cd ../docs
14+ git checkout main
15+ git pull
16+ cd ../docs-internal
17+ git checkout main
18+ git pull
19+ echo " > Both repositories are in main and up-to-date"
20+
21+ echo " > Set up remotes if they aren't there..."
22+ cd ../docs
23+ git remote show docs-internal || git remote add docs-internal ../docs-internal
24+ cd ../docs-internal
25+ git remote show docs || git remote add docs ../docs
26+ echo " > Remotes set on docs and docs-internal"
27+
28+ echo " > Fetch and merge both repositories..."
29+ cd ../docs
30+ git fetch docs-internal main
31+ git merge docs-internal/main
32+ cd ../docs-internal
33+ git fetch docs main
34+ git merge docs/main
35+ echo " > Both repositories have each other's latest changes in main"
36+
37+ echo " > Push up both repositories..."
38+ cd ../docs
39+ git push --no-verify
40+ cd ../docs-internal
41+ git push --no-verify
42+ echo " > Both repositories are pushed to origin"
You can’t perform that action at this time.
0 commit comments