From 4ec91905c3590e6ebc5108be57a47605928bb912 Mon Sep 17 00:00:00 2001
From: Tullio Sebastiani <tsebastiani@users.noreply.github.com>
Date: Wed, 24 Jan 2024 11:31:46 +0100
Subject: [PATCH] Github sync action

Signed-off-by: Tullio Sebastiani <tsebasti@redhat.com>
---
 .github/workflows/sync.yml | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
index 8b4c999..2f6deb3 100644
--- a/.github/workflows/sync.yml
+++ b/.github/workflows/sync.yml
@@ -1,14 +1,20 @@
 name: Sync Workflow
 on:
   workflow_dispatch:
+
+permissions: write-all
 jobs:
   sync:
     name: Sync krkn-hub to the upstream repo
     env:
-      GH_TOKEN: ${{ github.token }}
     runs-on: ubuntu-latest
     steps:
+    - name: Check out code
+      uses: actions/checkout@v3
     - name: Sync with GH CLI
       run: |
-        gh repo sync redhat-chaos/krkn-hub -b main
-
+        git remote add upstream https://github.com/krkn-chaos/krkn-hub.git
+        git fetch upstream
+        git checkout main
+        git rebase upstream/main
+        git push origin +main