Skip to main content

Create Pull Requests

Create pull requests programmatically using the GitHub API.

Created as a local alternative to:

  1. https://github.com/backstrokeapp/server/issues/102#issuecomment-451306979 Stopped working a few days ago with Recived an error: undefined
  2. https://github.com/wei/pull/issues/76#issue-397123888 Do not reset hard my default branch

Installation

Either clone this repository and run python setup.py develop or just use pip install githubpullrequests

Usage

$ githubpullrequests -h
usage: githubpullrequests [-h] [-f FILE] [-t TOKEN] [-mr MAXIMUM_REPOSITORIES]
                          [-c] [-d] [-s] [-ei ENABLE_ISSUES] [-as ADD_STARS]
                          [-wa WATCH_ALL]

Create Pull Requests, using GitHub API and a list of repositories.

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  The file with the repositories informations
  -t TOKEN, --token TOKEN
                        GitHub token with `public_repos` access, or the path
                        to a file with the Github token in plain text. The
                        only contents the file can have is the token,
                        optionally with a trailing new line.
  -mr MAXIMUM_REPOSITORIES, --maximum-repositories MAXIMUM_REPOSITORIES
                        The maximum count of repositories/requests to process
                        per file.
  -c, --cancel-operation
                        If there is some batch operation running, cancel it as
                        soons as possible.
  -d, --dry-run         Do a rehearsal of a performance or procedure instead
                        of the real one i.e., do not create any pull requests,
                        but simulates/pretends to do so.
  -s, --synced-repositories
                        Reports which repositories not Synchronized with Pull
                        Requests. This also resets/skips any last session
                        saved due old throw/raised exceptions, because to
                        compute correctly the repositories list, it is
                        required to know all available repositories.
  -ei ENABLE_ISSUES, --enable-issues ENABLE_ISSUES
                        Enable the issue tracker on all repositories for the
                        given user.
  -as ADD_STARS, --add-stars ADD_STARS
                        Add a star on all repositories for the given user.
  -wa WATCH_ALL, --watch-all WATCH_ALL
                        Enable watch for all repositories on the given user.

For example:

$ githubpullrequests -f repositories_list.txt

Example of repositories_list.txt:

[Anything Unique like evandrocoan/SublimePackageDefault]
    url = https://github.com/evandrocoan/SublimePackageDefault
    upstream = https://github.com/evandroforks/SublimePackageDefault
    branches = upstream_branch_name->fork_branch_name,

You need to define the environment variable GITHUBPULLREQUESTS_TOKEN with the GitHub access token with public_repos permission, or pass the command line argument -t token to githubpullrequests.

  1. https://stackoverflow.com/questions/47467039/how-to-create-github-pull-request-using-curl
  2. https://stackoverflow.com/questions/28391901/using-the-github-api-create-git-pull-request-without-checking-out-the-code

License

See the file LICENSE.txt

Metadata

Release files for githubpullrequests 0.3.3

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

Source distribution (sdist)

Source distribution for githubpullrequests 0.3.3
File Size Uploaded Provenance
githubpullrequests-0.3.3.tar.gz 22.9 kB Without provenance Details

Release files / githubpullrequests-0.3.3.tar.gz

Download URL githubpullrequests-0.3.3.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5dbd949b3e8915e906ac9561de6f259c766e3a7d1f029d642583221bd8f82596
BLAKE2b-256 checksum
How to use checksums
c6fa9ca048a13122119942a394fc5f6a0fe4c412d19d1dfaed20f261e1adb425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.8.0 tqdm/4.42.1 CPython/3.8.1

Security for githubpullrequests 0.3.3

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.

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