Skip to content

m github pr

Retrieve a pull request information.

example::

$ m github pr --owner microsoft --repo typescript 44710 | m json
{
    "headRefName": "ReduceExceptions",
    "headRefOid": "d9ae52cf49732a2d45b6cb7f4069205c88af39eb",
    "baseRefName": "main",
    "baseRefOid": "6452cfbad0afcc6d09b75e0a1e32da1d07e0b7ca",
    "title": "Reduce exceptions",
    "body": "...

Or use the --pretty option to avoid piping.

Source code in m/cli/commands/github/pr.py
class Arguments(BaseModel):
    """Retrieve a pull request information.

    example::

        $ m github pr --owner microsoft --repo typescript 44710 | m json
        {
            "headRefName": "ReduceExceptions",
            "headRefOid": "d9ae52cf49732a2d45b6cb7f4069205c88af39eb",
            "baseRefName": "main",
            "baseRefOid": "6452cfbad0afcc6d09b75e0a1e32da1d07e0b7ca",
            "title": "Reduce exceptions",
            "body": "...

    Or use the `--pretty` option to avoid piping.
    """

    owner: str = Arg(
        default=env('GITHUB_REPOSITORY_OWNER'),
        help='repo owner',
    )
    repo: str = Arg(
        help='repo name',
        required=True,
    )
    files: int = Arg(
        default=10,
        help='max number of files to retrieve',
    )
    pretty: bool = Arg(
        default=False,
        help='format json payload with indentation',
    )
    yaml: bool = Arg(
        default=False,
        help='use yaml format',
    )
    pr_number: int = Arg(
        help='the pr number',
        positional=True,
        required=True,
    )

Required arguments

--repo

repo name

Options

--owner

  • default: 'jmlopez-rod'

repo owner

--files

  • default: 10

max number of files to retrieve

--pretty

  • default: false

format json payload with indentation

--yaml

  • default: false

use yaml format

Positional arguments

pr_number

the pr number