Skip to main content

# git-submodule-updater

A tool to automate making GitHub Pull Requests about updating git submodules.

You should be able to just give it the name of a repo (e.g. mozilla/kuma) and it finds out which submodules there are and looks to see if they can be updated.

## Demo

Not really a demo but [this pull request](https://github.com/mdn/stumptown-renderer/pull/62) was entirely made from this script.

## Limitations and caveats

At the time of writing, this is a prototype. It’s doing the least possible to make the most basic thing work.

  • It requires that you’re allowed to push branches to the origin.

  • It only really works with GitHub.com

  • It’s doing the git clone with SSH. So not sure how to make this work in a server.

  • It’s only a CLI at the moment.

  • There’s no good way to auto-close now out-of-date older PRs

  • No unit tests

  • Not tested beyond the defaults of master and origin

  • It can only make 1 PR per the difference between the head and the submodule.

  • To see what the difference in a submodule update you have to rely on GitHub’s “Files changed” tab on the PR.

## Getting started

You’ll need a GitHub access token. Go to [github.com/settings/tokens](https://github.com/settings/tokens) and create a token, copy and paste it into your .env file or use export. E.g.

cat .env GITHUB_ACCESS_TOKEN=a36f6736…

pip install git-submodule-updater gsmu github.com/mdn/stumptown-renderer # for example

If you don’t use a .env file you can use:

GITHUB_ACCESS_TOKEN=a36f6736… gsmu myorg/myrepo

## Goal

This tool should be possible to run as a CLI and as a web server so it can be connected to a GitHub repo Webhook.

## Contributing

Clone this repo then run:

pip install -e “.[dev]”

That should have installed the CLI gsmu

gsmu –help

If you wanna make a PR, make sure it’s formatted with black and passes flake8.

Release files for git-submodule-updater 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-submodule-updater 0.0.1
File Size Uploaded
git-submodule-updater-0.0.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-submodule-updater 0.0.1
File Interpreter ABI Platform
git_submodule_updater-0.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 9.7 kB

Release files / git-submodule-updater-0.0.1.tar.gz

Download URL git-submodule-updater-0.0.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d87d6b437db7efddfa48192296142f91a3e6ce1686bd06165efeb352f0a9424e
BLAKE2b-256 checksum
How to use checksums
ab98a8b8cf7dc39487bc7973b57a60d3f6f41df9babcd07a18e05cbcdaf33851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release files / git_submodule_updater-0.0.1-py2.py3-none-any.whl

Download URL git_submodule_updater-0.0.1-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5cb1942722232832b304ea1760631272558bd3e652e63b2e0098c091c0a59efa
BLAKE2b-256 checksum
How to use checksums
b229087aa25a2dfa465ad33aeb328c0c481a00aee509afeaf40fa7745670a960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page