Skip to main content

github:pr

Gets infos about Github Pull Requests.

note

If no Github Repository is defined by ---repository (-r) option the default Magento 2 Github Repository magento/magento2 is used. For the Mage-OS repository, use the shortcut option --mage-os.

warning

The command uses the GitHub API which has rate limits for unauthenticated users.

tip

To avoid the rate limit, set a GitHub token in your environment (GITHUB_TOKEN) or use the --github-token option.

Usage

# Magento 2 Open Source
n98-magerun2.phar github:pr <number>
# Mage-OS
n98-magerun2.phar github:pr --mage-os <number>

Arguments

ArgumentDescription
numberPull Request Number

Options

OptionDescription
-r, --repository[=REPOSITORY]Repository to fetch from [default: "magento/magento2"]
--mage-osShortcut option to use the mage-os/mageos-magento2 repository.
-d, --patchDownload patch and prepare it for applying
-a, --applyApply patch to current working directory
--diffRaw diff download
--jsonShow pull request data as json
--github-token[=GITHUB-TOKEN]Github API token to avoid rate limits (can also be set via ENV variable GITHUB_TOKEN)

Example: Create a patch file from PR

n98-magerun2.phar github:pr --patch <number>