From 0a5205a1aec380b1312b5c38ce285b54705f560f Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:54:07 +0000 Subject: [PATCH 01/13] Delete clone_and_manage.py --- clone_and_manage.py | 56 --------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 clone_and_manage.py diff --git a/clone_and_manage.py b/clone_and_manage.py deleted file mode 100644 index 4d95641..0000000 --- a/clone_and_manage.py +++ /dev/null @@ -1,56 +0,0 @@ -import os -import requests -import git -from pathlib import Path -import shutil - -# Your GitHub repository URL and token -repo_url = "https://github.com/Scratch-Coding-Hut/Scratch-Coding-Hut" -token = "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" # This is your PAT stored as a secret in GitHub - -# Function to clone the repo using GitHub API -def clone_repo(): - # Clone the repo using GitPython (it can also clone using git command internally) - repo_dir = Path("./Scratch-Coding-Hut") - if repo_dir.exists(): - shutil.rmtree(repo_dir) # Remove the old repo if it exists, but not the Python script - git.Repo.clone_from(repo_url, repo_dir, depth=1) - return repo_dir - -# Function to copy files excluding .github and .git folder -def copy_files(src_dir, dest_dir): - # Iterate over the source directory and copy files, skipping .github and .git - for item in os.listdir(src_dir): - if item not in [".github", ".git"]: # Skip both .github and .git folder - src_path = src_dir / item - dest_path = dest_dir / item - if src_path.is_dir(): - shutil.copytree(src_path, dest_path) # Copy directories - else: - shutil.copy2(src_path, dest_path) # Copy files - -# Function to set Git config -def set_git_config(): - # Set the Git config for user name and email to avoid identity issues - os.system('git config --global user.email "github-actions@github.com"') - os.system('git config --global user.name "GitHub Actions"') - -# Main function -def main(): - # Step 1: Set Git config - set_git_config() - - # Step 2: Clone the repo - src_repo_dir = clone_repo() - - # Step 3: Prepare the destination path (current repository) - dest_repo_dir = Path(".") # This is the current directory where the GitHub Action is running - - # Step 4: Copy files excluding .github and .git folders - copy_files(src_repo_dir, dest_repo_dir) - - # Step 5: Clean up - Remove the cloned repo directory if you don't need it anymore (excluding Python script) - shutil.rmtree(src_repo_dir) - -if __name__ == "__main__": - main() From f786fb88235cb29656721626f045a9d98c42229c Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:54:34 +0000 Subject: [PATCH 02/13] Update Sync.yml --- .github/workflows/Sync.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Sync.yml b/.github/workflows/Sync.yml index ec76832..04775cf 100644 --- a/.github/workflows/Sync.yml +++ b/.github/workflows/Sync.yml @@ -1,20 +1,23 @@ -name: Repo File Sync +name: Sync Repos on: schedule: - - cron: "*/1 * * * *" # Runs every minute - workflow_dispatch: # Manual trigger if needed + - cron: '*/1 * * * *' # Runs every minute + workflow_dispatch: # Allows manual triggering jobs: sync: runs-on: ubuntu-latest steps: - - name: Checkout Source Repo - uses: actions/checkout@v3 + - name: Checkout source repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: scratch-coding-hut/Scratch-Coding-Hut + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - name: Repo File Sync Action - uses: BetaHuhn/repo-file-sync-action@v1.21.1 - with: - GH_PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - CONFIG_PATH: .github/sync-config.yml # Use custom config to sync src + - name: Push to destination repo + run: | + git remote add destination https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/kRxZykRxZy/Scratch-Coding-Hut.git + git push destination main --force From a639ebe3cfc7766a984d122d04242baea66dc1f7 Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:55:24 +0000 Subject: [PATCH 03/13] Delete .github/sync-config.yml --- .github/sync-config.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .github/sync-config.yml diff --git a/.github/sync-config.yml b/.github/sync-config.yml deleted file mode 100644 index 424eeb6..0000000 --- a/.github/sync-config.yml +++ /dev/null @@ -1,7 +0,0 @@ -repos: - - "Scratch-Coding-Hut/Scratch-Coding-Hut" # Correct target repo - -files: - - source: "/src/" # Copy all files inside 'src' folder - dest: "/" # Place them in the root of the target repo - delete: true # Delete extra files in the target repo From 8639f32536c498a39bc173feb01e5414140738e5 Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:55:49 +0000 Subject: [PATCH 04/13] Delete .github/workflows/Sync.yml --- .github/workflows/Sync.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/Sync.yml diff --git a/.github/workflows/Sync.yml b/.github/workflows/Sync.yml deleted file mode 100644 index 04775cf..0000000 --- a/.github/workflows/Sync.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Sync Repos - -on: - schedule: - - cron: '*/1 * * * *' # Runs every minute - workflow_dispatch: # Allows manual triggering - -jobs: - sync: - runs-on: ubuntu-latest - - steps: - - name: Checkout source repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - repository: scratch-coding-hut/Scratch-Coding-Hut - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - - name: Push to destination repo - run: | - git remote add destination https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/kRxZykRxZy/Scratch-Coding-Hut.git - git push destination main --force From eecf35ae40d1765cf476ab1e94f66edf667121ab Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:56:08 +0000 Subject: [PATCH 05/13] Create Sync-yml.yml --- .github/workflows/Sync-yml.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/Sync-yml.yml diff --git a/.github/workflows/Sync-yml.yml b/.github/workflows/Sync-yml.yml new file mode 100644 index 0000000..04775cf --- /dev/null +++ b/.github/workflows/Sync-yml.yml @@ -0,0 +1,23 @@ +name: Sync Repos + +on: + schedule: + - cron: '*/1 * * * *' # Runs every minute + workflow_dispatch: # Allows manual triggering + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout source repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: scratch-coding-hut/Scratch-Coding-Hut + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Push to destination repo + run: | + git remote add destination https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/kRxZykRxZy/Scratch-Coding-Hut.git + git push destination main --force From 597f15dc8d2ded0e26bf9d916f0e743c25acff86 Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:57:21 +0000 Subject: [PATCH 06/13] Update Sync-yml.yml --- .github/workflows/Sync-yml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Sync-yml.yml b/.github/workflows/Sync-yml.yml index 04775cf..7fafc48 100644 --- a/.github/workflows/Sync-yml.yml +++ b/.github/workflows/Sync-yml.yml @@ -15,7 +15,7 @@ jobs: with: fetch-depth: 0 repository: scratch-coding-hut/Scratch-Coding-Hut - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + token: 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 - name: Push to destination repo run: | From 7fd388ddf5905ea99cd4fc2051c4266625294179 Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 07:59:08 +0000 Subject: [PATCH 07/13] Update Sync-yml.yml --- .github/workflows/Sync-yml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Sync-yml.yml b/.github/workflows/Sync-yml.yml index 7fafc48..d614794 100644 --- a/.github/workflows/Sync-yml.yml +++ b/.github/workflows/Sync-yml.yml @@ -19,5 +19,5 @@ jobs: - name: Push to destination repo run: | - git remote add destination https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/kRxZykRxZy/Scratch-Coding-Hut.git + git remote add destination https://x-access-token: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@github.com/kRxZykRxZy/Scratch-Coding-Hut.git git push destination main --force From 71a1e987cf646aa8f0faa21eb662bc2a674b0ef7 Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 08:00:01 +0000 Subject: [PATCH 08/13] Delete .github/workflows/Sync-yml.yml --- .github/workflows/Sync-yml.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/Sync-yml.yml diff --git a/.github/workflows/Sync-yml.yml b/.github/workflows/Sync-yml.yml deleted file mode 100644 index d614794..0000000 --- a/.github/workflows/Sync-yml.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Sync Repos - -on: - schedule: - - cron: '*/1 * * * *' # Runs every minute - workflow_dispatch: # Allows manual triggering - -jobs: - sync: - runs-on: ubuntu-latest - - steps: - - name: Checkout source repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - repository: scratch-coding-hut/Scratch-Coding-Hut - token: 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 - - - name: Push to destination repo - run: | - git remote add destination https://x-access-token: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@github.com/kRxZykRxZy/Scratch-Coding-Hut.git - git push destination main --force From 07841b8713236af999c1fdf56d3d522736c8836c Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 08:00:17 +0000 Subject: [PATCH 09/13] Create Sync.yml --- .github/workflows/Sync.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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 0000000..d614794 --- /dev/null +++ b/.github/workflows/Sync.yml @@ -0,0 +1,23 @@ +name: Sync Repos + +on: + schedule: + - cron: '*/1 * * * *' # Runs every minute + workflow_dispatch: # Allows manual triggering + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout source repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: scratch-coding-hut/Scratch-Coding-Hut + token: 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 + + - name: Push to destination repo + run: | + git remote add destination https://x-access-token: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@github.com/kRxZykRxZy/Scratch-Coding-Hut.git + git push destination main --force From f9141ab67a947132844056aa35a6201870565efb Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 08:01:11 +0000 Subject: [PATCH 10/13] Rename Sync.yml to Sync-Data.yml --- .github/workflows/{Sync.yml => Sync-Data.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{Sync.yml => Sync-Data.yml} (100%) diff --git a/.github/workflows/Sync.yml b/.github/workflows/Sync-Data.yml similarity index 100% rename from .github/workflows/Sync.yml rename to .github/workflows/Sync-Data.yml From ff486e6484e2078b4c8e0b82983654a2e2d7429c Mon Sep 17 00:00:00 2001 From: kRxZykRxZy <192328467+kRxZykRxZy@users.noreply.github.com> Date: Sat, 29 Mar 2025 11:24:06 +0000 Subject: [PATCH 11/13] Update sitemaplinks.html --- src/Wiki/sitemaplinks.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Wiki/sitemaplinks.html b/src/Wiki/sitemaplinks.html index c081500..f15a109 100644 --- a/src/Wiki/sitemaplinks.html +++ b/src/Wiki/sitemaplinks.html @@ -181,7 +181,7 @@