Skip to content

m github build_sha

Provide the build sha.

Given the GITHUB_SHA (a merge commit it fetches the sha of the actual commit we thought we were building.

example::

$ m github build_sha \
    --owner jmlopez-rod \
    --repo m \
    --sha 6bf3a8095891c551043877b922050d5b01d20284
fa6a600729ffbe1dfd7fece76ef4566e45fbfe40

The sha can be obtained in Github by looking at the output of the checkout action.

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

Source code in m/cli/commands/github/build_sha.py
class Arguments(BaseModel):
    r"""Provide the build sha.

    Given the GITHUB_SHA (a merge commit it fetches the sha of the actual
    commit we thought we were building.

    example::

        $ m github build_sha \
            --owner jmlopez-rod \
            --repo m \
            --sha 6bf3a8095891c551043877b922050d5b01d20284
        fa6a600729ffbe1dfd7fece76ef4566e45fbfe40

    The sha can be obtained in Github by looking at the output of the
    checkout action.

    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,
    )

Required arguments

--repo

repo name

--sha

commit sha

Options

--owner

  • default: 'jmlopez-rod'

repo owner