From e36ee5b681679276fbcb25dfdfbb3d36a6581eba Mon Sep 17 00:00:00 2001 From: Sarang Surve Date: Tue, 6 Feb 2024 00:25:43 +0530 Subject: [PATCH 1/3] Create main.yml --- .github/workflows/main.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..b68ac521 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: Sync With Forked Repo + +on: + workflow_dispatch: # allow manual run + schedule: + - cron: '0 0 * * *' # every night + +jobs: + syncing_with_forked_repo: + runs-on: ubuntu-latest + + env: + GH_TOKEN: ${{ secrets.TOKEN }} + + steps: + - name: Checkout Repository + uses: actions/checkout@main + + - name: Set up Git + run: | + git config user.email "sarangsurve126@gmail.com" + git config user.name "sarangsurve" + git remote add upstream https://github.com/algorithm-visualizer/algorithms.git + git fetch upstream master + git checkout -b update-from-upstream master + git merge --allow-unrelated-histories -X theirs upstream/master + git push origin update-from-upstream:master From cbc1734946261e07faf0042e849f54dda16b5cc3 Mon Sep 17 00:00:00 2001 From: sarangsurve Date: Wed, 7 Feb 2024 22:12:42 +0530 Subject: [PATCH 2/3] Update main.yml --- .github/workflows/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b68ac521..75a0a232 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,11 @@ jobs: git config user.name "sarangsurve" git remote add upstream https://github.com/algorithm-visualizer/algorithms.git git fetch upstream master - git checkout -b update-from-upstream master - git merge --allow-unrelated-histories -X theirs upstream/master - git push origin update-from-upstream:master + + - name: Check for changes from upstream + run: | + if [ $(git rev-list --count HEAD..upstream/master) -gt 0 ]; then + git checkout -b update-from-upstream master + git merge --allow-unrelated-histories -X theirs upstream/master + git push origin update-from-upstream:master + fi From bfeba9f5d228ea4e7c95c25cc9c9439792e57829 Mon Sep 17 00:00:00 2001 From: Sarang Surve Date: Tue, 8 Apr 2025 17:56:47 +0530 Subject: [PATCH 3/3] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75a0a232..3d04ff28 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Sync With Forked Repo on: workflow_dispatch: # allow manual run schedule: - - cron: '0 0 * * *' # every night + - cron: '0 0 1 * *' # every night jobs: syncing_with_forked_repo: