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