Skip to content

Commit 9927788

Browse files
committed
Add an action to sync the wiki repos
1 parent dbca772 commit 9927788

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/sync.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Based on https://www.growingwiththeweb.com/2016/07/enabling-pull-requests-on-github-wikis.html
2+
name: Sync to Dot Wiki
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: |
12+
# Setup Git
13+
git config user.name "typescript-bot"
14+
git config user.email "[email protected]"
15+
# Remove the un-auth'd origin
16+
git remote remove origin
17+
# Switch to authed remotes for both the - and the .
18+
git remote add origin https://[email protected]/microsoft/TypeScript-wiki.git > /dev/null 2>&1
19+
git remote add upstream https://[email protected]/microsoft/TypeScript.wiki.git > /dev/null 2>&1
20+
git fetch origin
21+
git fetch upstream
22+
# Merge them all together
23+
git merge upstream/master --no-edit
24+
# Push them both
25+
git push origin HEAD:master > /dev/null 2>&1
26+
git push upstream HEAD:master > /dev/null 2>&1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)