0

i am trying to rebase the dev-ci branch whenever something gets pushed to the dev branch but i keep getting the error that remote branch is ahead.

here is my code

name: Development to Development-CI Sync

on:
  push:
    branches:
      - development

permissions:
  contents: write

jobs:
  sync:
    runs-on: ubuntu-latest
    name: Sync changes from development to development-ci

    steps:

      - uses: actions/labeler@v4
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}


      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: "18.14.1"

      - name: Setup Config
        run: |
          git config pull.rebase true
          git config user.name 'me505'
          git config user.email 'me505@users.noreply.github.com'

      
      - name: Create development-ci branch if it doesn't exist and sync to the latest remote branch
        run: |
          git checkout -b development-ci
          git fetch origin development-ci
          git merge development-ci
          git rebase development 
     
      - name: Push changes to development-ci
        run: |
          git push origin development-ci

i expected it to just copy everything over from dev to dev-ci and push it

i tried doing git fetch and merge manually which didnt work origin development-ci

0 Answers0