git-multi-repo-updater is a command line tool for updating multiple GitLab or GitHub repositories with a single command.
Usage
Generate an access token at GitLab or GitHub and set it as environment variable:
export GITLAB_ACCESS_TOKEN=<token>
export GITHUB_OAUTH_TOKEN=<token>
export GIT_TOKEN=<token> # This one is used if previous ones are not found
Provide a list of repositories and a script or a command to run inside each of them:
git-multi-repo-updater --repos repos.txt update_repo.py
Where repos.txt could be:
https://gitlab.com/<handle>/<repo-title>
https://gitlab.com/<handle>/<repo-title2>
https://github.com/<handle>/<repo-title>
Try it yourself:
git-multi-repo-updater \
--repo https://github.com/<handle>/<repo-title> \
--branch-name add-hello-world-file \
--commit-message "Add hello-world.txt file" \
touch hello-world.txt
These steps will be executed for each specified repository:
- The repository will be cloned into
/tmp/directory. - A new branch will be created or fetched if it already exists.
- The command or a script will be executed inside the repository.
- A commit containing all the changes will be created.
- Newly created commit will be pushed to remote repository.
- A pull request will be created.
- [optional] A comment will be left next to the PR.
- [optional] The pull request will be merged.
These options could be used to specify more details:
| Option | Description | Type | Required |
|---|---|---|---|
-r --repo --repos |
Repo URL or a file containing repo URLs | String | Yes |
-m --commit-message |
A commit message which will be used for all of the changes made. | String | No |
-b --branch-name |
A name of a branch which will be created or used to add a commit and to create pull request from. | String | No |
--delay |
Minimum delay in seconds between API calls | Number | No |
Efficiency
git-multi-repo-updater is implemented in Python and uses coroutines to make multiple parallel API calls. Delays are being made after each API call in order not to get throttled.
Roadmap
- Make API calls to GitHub
- Package and release to PyPi
- Run command as command line tool
- Stand-alone executable file download in Github releases.
- Make API calls to GitLab
- Support different API calls
- Advanced features:
- Merge PRs which have all requirements like approvals met.
Development
make venv - will create virtual env with dev dependencies.
make check - will run Flake8, MyPy and PyTest checks.
Related projects
This tool was inspired by:
Metadata
Release files for git-multi-repo-updater 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| git_multi_repo_updater-0.1.4.tar.gz | 23.0 kB | Without provenance | Details for git_multi_repo_updater-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| git_multi_repo_updater-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for git_multi_repo_updater-0.1.4-py3-none-any.whl |
Total release size: 42.9 kB
Release files / git_multi_repo_updater-0.1.4.tar.gz
| Download URL | git_multi_repo_updater-0.1.4.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8165339a00a36c3f5337123a42da41a0aab2236e2accb53cc95747de33d3f5a
|
|
BLAKE2b-256 checksum How to use checksums |
2ab48a2926f4d308d3e4142456b0d1a386eedbc558501e377176da6a783f0918
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.23.1
|
Release files / git_multi_repo_updater-0.1.4-py3-none-any.whl
| Download URL | git_multi_repo_updater-0.1.4-py3-none-any.whl |
|---|---|
| Size | 19.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
938920c526e82e315630180224d294e513a02e6e828f95625a90c683ec43d503
|
|
BLAKE2b-256 checksum How to use checksums |
956a24bd9b2ec606693e1e692b167477712771f97183a72d02f8110d9fe8c5fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.23.1
|
Security for git-multi-repo-updater 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.