From 0a4a445da782c3c09c13d628cbf5adaf6728fced Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 11 Aug 2024 23:56:23 +0700 Subject: [PATCH 1/2] Create sync-fork.yml --- .github/workflows/sync-fork.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/sync-fork.yml diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml new file mode 100644 index 0000000..1e657e0 --- /dev/null +++ b/.github/workflows/sync-fork.yml @@ -0,0 +1,42 @@ +name: 'Upstream Sync' + +on: + push: + branches: + - '*' + schedule: + - cron: '0 0 * * *' + + workflow_dispatch: + +jobs: + sync_latest_from_upstream: + runs-on: ubuntu-latest + name: Sync latest commits from upstream repo + + steps: + - name: Checkout target repo + uses: actions/checkout@v4 + with: + ref: main + + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1 + with: + target_sync_branch: main + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_branch: main + upstream_sync_repo: cslant/telegram-git-notifier + upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }} + + - 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 }} From 82d1eff5e92614bb4553b967dd2c9ff3ad58617e Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Tue, 13 Aug 2024 20:45:57 +0700 Subject: [PATCH 2/2] Update sync-fork.yml --- .github/workflows/sync-fork.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml index 1e657e0..121f223 100644 --- a/.github/workflows/sync-fork.yml +++ b/.github/workflows/sync-fork.yml @@ -5,7 +5,7 @@ on: branches: - '*' schedule: - - cron: '0 0 * * *' + - cron: '*/5 * * * *' workflow_dispatch: