Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbelderbos/github-tools
https://github.com/bbelderbos/github-tools
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/bbelderbos/github-tools
- Owner: bbelderbos
- Created: 2023-03-24T13:01:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-25T08:40:38.000Z (over 1 year ago)
- Last Synced: 2023-10-31T19:31:01.774Z (11 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Tools
Using the GitHub API to automate certain tasks.
## Copying issues
Issues were not being copied over from a template repo we have. So that's the first task we fixed:
### Example:
```
$ python -m ghtools --destination some_repo
Copying milestones ...
Result:
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Status ┃ Milestone ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ✅ │ Copied milestone Some milestone │
│ ✅ │ Copied milestone Some other milestone │
│ ✅ │ Copied milestone A third milestone │
└────────┴────────────────────────────────────────────────────────────────────────────┘
Copying issues ...
Result:
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Status ┃ Issue ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ ✅ │ Copied issue Issue Feature 1 │
│ ✅ │ Copied issue Some other issue │
│ ✅ │ Copied issue Yet another issue │
└────────┴──────────────────────────────────────────────────────────┘
```### Config
You can set the following environment variables:
```
$ more .env-template
GITHUB_REPO_TOKEN=
REPO_OWNER=
SOURCE_REPO=
DESTINATION_REPO=
````GITHUB_REPO_TOKEN` and `REPO_OWNER` are required. We only support the same owner for source and destination repos at this point.
Source and destination repos can be given from the command line, if omitted the script will look at the `SOURCE_REPO` and `DESTINATION_REPO` environment variables.
### Usage options
You can also chose to only copy milestones or issues:
```
$ python -m ghtools --helpUsage: python -m ghtools [OPTIONS]
Copy milestones and issues from source to destination repo
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --source TEXT [default: TemplateRepo] │
│ --destination TEXT [default: None] │
│ --copy-milestones --no-copy-milestones [default: copy-milestones] │
│ --copy-issues --no-copy-issues [default: copy-issues] │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```