From 00ba7a82f94abffa8617978ddc90167487f4ee7e Mon Sep 17 00:00:00 2001 From: nijama Date: Sun, 14 Apr 2024 02:09:02 -0500 Subject: [PATCH] automatically sync fork --- .github/workflows/update-fork.yml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update-fork.yml diff --git a/.github/workflows/update-fork.yml b/.github/workflows/update-fork.yml new file mode 100644 index 00000000..67a6b7f5 --- /dev/null +++ b/.github/workflows/update-fork.yml @@ -0,0 +1,36 @@ +name: Update Fork + +on: + schedule: + # This runs the workflow automatically every monday at 05:55 AM UTC + - cron: "55 5 * * 1" + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: "main" # Ensures the 'main' branch is checked out + fetch-depth: 0 # Fetches all history for branch comparison + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # Uses PAT to authenticate + + - name: Configure Git + run: | + git config --global user.email "nijama.dev@gmail.com" + git config --global user.name "nijamaDev" + + - name: Add upstream remote + run: | + git remote add upstream https://github.com/benvinegar/counterscale + git fetch upstream + + - name: Rebase with upstream + run: | + git checkout main + git rebase upstream/main + + - name: Force push to main + run: | + git push origin main --force