From 7651646df57c41c3702c80af0e885a96d120b829 Mon Sep 17 00:00:00 2001 From: Tau Date: Mon, 5 Aug 2024 16:05:22 +0200 Subject: [PATCH] created sync workflow --- .github/workflows/sync-main.yml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/sync-main.yml diff --git a/.github/workflows/sync-main.yml b/.github/workflows/sync-main.yml new file mode 100644 index 0000000..a056e18 --- /dev/null +++ b/.github/workflows/sync-main.yml @@ -0,0 +1,36 @@ +name: Sync Main Branch + +on: + workflow_dispatch: + +jobs: + check_base_status: + runs-on: ubuntu-latest + steps: + - name: Clone base image. + uses: actions/checkout@v4 + with: + repository: Vanilla-OS/core-image + + - name: Check if base is up to date. + run: | + git fetch origin + main_head=$( git rev-parse origin/main ) + dev_head=$( git rev-parse origin/dev ) + echo main branch is at: $main_head + echo dev branch is at: $dev_head + [ "$main_head" = "$dev_head" ] + + sync: + runs-on: ubuntu-latest + needs: check_base_status + + steps: + - uses: actions/checkout@v4 + with: + ref: dev + fetch-depth: 0 + + - name: Push dev to main. + run: | + git push origin dev:main