diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 00000000..b98e4953 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,22 @@ +name: Sync to Dot Wiki +on: + push: + branches: [master] + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - run: | + git config user.name "typescript-bot" + git config user.email "bot@typescriptlang.org" + git remote remove origin + git remote add origin https://$GITHUB_TOKEN@github.com/microsoft/TypeScript-wiki.git > /dev/null 2>&1 + git remote add upstream https://$GITHUB_TOKEN@github.com/microsoft/TypeScript.wiki.git > /dev/null 2>&1 + git fetch origin + git fetch upstream + git merge upstream/master --no-edit + git push origin HEAD:master > /dev/null 2>&1 + git push upstream HEAD:master > /dev/null 2>&1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}