trying w/ unrelated #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |