Fix reading of dates in issues.json when exporting
Fix a typo / extra trailing quote
Use pytz for offset-aware time calculations
This script is a set of tools I commonly use to organize teamwork on GitHub. Currently it can:
Warning: the code of this script is not very clean, and can break. Warning: also, I only maintain this for myself. If you like it -- cool, feel free to copy and adjust as you see fit.
You can use standard Python virtualenv / pip tools to install dependencies and this script as well.
For Nix / NixOS users, if you use flakes:
# In inputs
inputs = {
...
git-plan.url = sourcehut:~knazarov/git-plan;
git-plan.inputs.nixpkgs.follows = "nixpkgs";
...
}
# Then you can add git-plan.overlays.default as an overlay
# And then:
my_python = (pkgs.python3.withPackages (ps: with ps; [
git_plan]));
After this, you can use python -m git_plan <command_line_arguments>
Create a file called github-google-sheets.ini
and fill it as follows:
[default]
github_token=<your_personal_access_token>
github_org=<github_org_name>
google_sheet_id=<google_sheet_id>
google_sheet_name=<title_of_the_file_you_want>
slack_webhook=<slack_webhook_url_for_stale_pr_notifications>
pr_notify_repos=<reponame_1>,<reponame_2>,...
[<milestone name>]
<reponame_1>=<milestone name>
<reponame_2>=<milestone name>
...
You can get a personal API token for GitHub here: https://github.com/settings/tokens . Google sheet ID can be copied from the URL in your browser.
How to synchronise:
./git-plan.sh sync
There are request limits, and you can only do 5000 requests per hour. If you cross that limit, the script will pause for 10 minutes and try to continue fetching.
The synchronization is also incremental, so if you re-start the script, it will resume where it finished last time. You can run it periodically to fetch new issues.
If you want to run as a service, do:
./git-plan.sh daemon
To view your issues locally, you can export them to a tsv
file like this:
./git-plan.sh export tsv myissues.tsv
If you want to view issues with Microsoft Excel, do this:
./git-plan.sh export xlsx myissues.xlsx