From 6b61d2f9b7bd13841d32c7bdc665d6ba1e4d7e77 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros Date: Thu, 13 Feb 2025 20:51:52 +0100 Subject: [PATCH] update Signed-off-by: Coleen Iona Quadros --- .github/workflows/rhobs-obs-api-sync.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/rhobs-obs-api-sync.yml diff --git a/.github/workflows/rhobs-obs-api-sync.yml b/.github/workflows/rhobs-obs-api-sync.yml new file mode 100644 index 000000000..e589871ed --- /dev/null +++ b/.github/workflows/rhobs-obs-api-sync.yml @@ -0,0 +1,36 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 0 * * *' #every 24h + workflow_dispatch: + +permissions: + contents: write + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout your forked repository + uses: actions/checkout@v4 + with: + repository: rhobs/api + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Add upstream repository + run: | + git remote add upstream https://github.com/observatorium/api + git fetch upstream + + - name: Sync with upstream/main + run: | + git fetch upstream main + git checkout -B main origin/main + git merge upstream/main + git push origin main + + - name: Clean up + run: | + git remote remove upstream \ No newline at end of file