From 95e98610e66a9a33fcc94a9789fa41ec4595a9e0 Mon Sep 17 00:00:00 2001 From: Tolga Ozen <39353278+tolgaOzen@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:18:48 +0300 Subject: [PATCH 1/2] chore(sync): synchronize with permify pro repo --- .github/workflows/sync.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..1acb32dda --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,21 @@ +name: Sync to Permify Pro + +on: + push: + branches: + - master + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout source repository + uses: actions/checkout@v2 + + - name: Push changes to the destination repository + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GH_TOKEN }} + repository: Permify/permify-pro + branch: sync + force: true From 0063c5214d4423220ba57adb09552f338245a21f Mon Sep 17 00:00:00 2001 From: Tolga Ozen <39353278+tolgaOzen@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:05:59 +0300 Subject: [PATCH 2/2] feat: sync with upstream action --- .github/workflows/sync.yml | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 1acb32dda..6c31c4562 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -1,21 +1,44 @@ name: Sync to Permify Pro - on: - push: - branches: - - master + schedule: + - cron: '0 7 * * 1,4' + workflow_dispatch: jobs: - sync: + sync_latest_from_upstream: runs-on: ubuntu-latest + name: Sync latest commits from upstream repo + steps: - - name: Checkout source repository - uses: actions/checkout@v2 + # REQUIRED step + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v3 + with: + ref: master + persist-credentials: false - - name: Push changes to the destination repository - uses: ad-m/github-push-action@master + # REQUIRED step + # Step 2: run the sync action + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 with: - github_token: ${{ secrets.GH_TOKEN }} - repository: Permify/permify-pro - branch: sync - force: true + target_sync_branch: master + target_repo_token: ${{ secrets.GH_TOKEN }} + upstream_sync_branch: sync + upstream_sync_repo: Permify/permify-pro + upstream_repo_access_token: ${{ secrets.GH_TOKEN }} + test_mode: true + + # Step 3: Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: echo ${{ steps.sync.outputs.has_new_commits }}