TypeScript/.github/workflows/sync-branch.yaml
Orta Therox b603a04eed
Switch references to master to main in the codebase + validating infra post-main migration (#44347)
* Update package.json

* Remove references to master in the codebase

* Add more master - main
2021-06-01 20:44:18 +01:00

36 lines
952 B
YAML

name: Sync branch with master
on:
repository_dispatch:
types: sync-branch
workflow_dispatch:
inputs:
branch_name:
description: 'Target Branch Name'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Use node version 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
fetch-depth: 0
# This does a test post-merge and only pushes the result if the test succeeds
# required client_payload members:
# branch_name - the target branch
- run: |
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
git fetch origin main
git merge origin/main --no-ff
npm ci
npm test
git push