From d7fc15b0d696436da32a026e13cc99acb8ef92a7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 06:12:51 +0000 Subject: [PATCH 1/3] feat: Add CI/CD pipeline using GitHub Actions This commit introduces a GitHub Actions workflow for Continuous Integration. The workflow (`.github/workflows/ci.yml`): - Triggers on push or pull request to the `master` branch. - Runs jobs on `ubuntu-latest`. - Tests across a matrix of Python versions: 3.9, 3.10, 3.11, 3.12, and 3.13. - Includes steps to: - Checkout repository code. - Set up the specified Python version. - Install dependencies from `requirements.txt`. - Run unit tests using `python -m unittest test_sbg.py`. A status badge for this CI workflow has also been added to `README.md`. You will need to replace the placeholder owner and repository name in the badge URL for it to function correctly. --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cbc4fe9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Run tests + run: | + python -m unittest test_sbg.py diff --git a/README.md b/README.md index 679ac17..5bb2256 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # GitLab Group Cloner & Updater +[![CI](https://github.com/YOUR_USERNAME_OR_ORG/YOUR_REPO_NAME/actions/workflows/ci.yml/badge.svg)](https://github.com/YOUR_USERNAME_OR_ORG/YOUR_REPO_NAME/actions/workflows/ci.yml) + A command-line Python tool to **clone** or **update** (_pull_) **all** GitLab repositories under one or more groups (including nested subgroups), organizing them into a mirror directory tree that matches each project’s namespace. --- From 4fde8164e4964210eae35751fe69717cd72d7a2b Mon Sep 17 00:00:00 2001 From: tutunak Date: Thu, 29 May 2025 08:19:03 +0200 Subject: [PATCH 2/3] fix: Update CI badge link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bb2256..2c1bcfe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitLab Group Cloner & Updater -[![CI](https://github.com/YOUR_USERNAME_OR_ORG/YOUR_REPO_NAME/actions/workflows/ci.yml/badge.svg)](https://github.com/YOUR_USERNAME_OR_ORG/YOUR_REPO_NAME/actions/workflows/ci.yml) +[![CI](https://github.com/tutunak/sb-gitlab/actions/workflows/ci.yml/badge.svg)](https://github.com/sb-gitlab/sb-gitlab/actions/workflows/ci.yml) A command-line Python tool to **clone** or **update** (_pull_) **all** GitLab repositories under one or more groups (including nested subgroups), organizing them into a mirror directory tree that matches each project’s namespace. From a4a49e372d420e06b8d3114aca0ea08417742617 Mon Sep 17 00:00:00 2001 From: tutunak Date: Thu, 29 May 2025 08:19:51 +0200 Subject: [PATCH 3/3] fix: Update script name in usage examples in README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c1bcfe..f3cf778 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ A command-line Python tool to **clone** or **update** (_pull_) **all** GitLab re ## Usage ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url \ --token \ --group-ids [ …] \ @@ -71,7 +71,7 @@ Arguments: Clone or update all projects under group **42** into `./repos` via HTTPS: ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url https://gitlab.com \ --token $GITLAB_TOKEN \ --group-ids 42 \ @@ -81,7 +81,7 @@ python clone_or_update_groups_by_namespace.py \ Clone or update projects from two groups by full path, using SSH: ```bash -python clone_or_update_groups_by_namespace.py \ +python sbg.py \ --gitlab-url https://gitlab.example.com \ --token $GITLAB_TOKEN \ --group-ids team/backend team/frontend \