Skip to content

trying w/ unrelated #12

trying w/ unrelated

trying w/ unrelated #12

Workflow file for this run

name: Push to Main
on:
push:
branches:
- github
jobs:
push_to_main:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check if main branch exists on remote
run: git ls-remote --exit-code --heads origin main || echo "::set-output name=branch_exists::false"
id: check_main_branch
- name: Create main branch if it doesn't exist
if: steps.check_main_branch.outputs.branch_exists == 'false'
run: |
git checkout -b main
git push -u origin main
- name: Fetch main branch
run: git fetch origin main
- name: Merge changes into main
run: |
git checkout main
git merge --allow-unrelated-histories ${{ github.ref }}
- name: Push changes to main
run: git push origin main