Skip to content

m github status

Create a commit status.

  • https://docs.github.com/en/rest/reference/repos#create-a-commit-status

example::

$ m github status \
    --owner jmlopez-rod \
    --repo pysync \
    --sha [sha] \
    --context github-check \
    --state pending \
    --description 'running checks'

The owner option defaults to the value of the environment variable GITHUB_REPOSITORY_OWNER.

Source code in m/cli/commands/github/status.py
class Arguments(BaseModel):
    r"""Create a commit status.

    - https://docs.github.com/en/rest/reference/repos#create-a-commit-status

    example::

        $ m github status \
            --owner jmlopez-rod \
            --repo pysync \
            --sha [sha] \
            --context github-check \
            --state pending \
            --description 'running checks'

    The `owner` option defaults to the value of the environment variable
    `GITHUB_REPOSITORY_OWNER`.
    """

    owner: str = Arg(
        default=env('GITHUB_REPOSITORY_OWNER'),
        help='repo owner',
    )
    repo: str = Arg(
        help='repo name',
        required=True,
    )
    sha: str = Arg(
        help='commit sha',
        required=True,
    )
    context: str = Arg(
        help='unique identifier for the status (a name?)',
        required=True,
    )
    state: str = ArgProxy(
        '--state',
        required=True,
        choices=['error', 'failure', 'pending', 'success'],
        help='the state of the status',
    )
    description: str = Arg(
        help='a short description of the status',
        required=True,
    )
    url: str | None = Arg(
        help='URL to associate with this status',
    )

Required arguments

--repo

repo name

--sha

commit sha

--context

unique identifier for the status (a name?)

--description

a short description of the status

Options

--owner

  • default: 'jmlopez-rod'

repo owner

--state

  • choices: error, failure, pending, success

the state of the status

--url

URL to associate with this status