repomatic.cli.github module¶
GitHub commands of the repomatic CLI: issues, pull requests and labels.
repomatic.cli.main.COMMANDS registers each command here, and files it
under its help section.
- repomatic.cli.github.SPONSOR_LABEL = '💖 sponsor'¶
The label
sponsor-labelapplies, asrepomatic/data/labels.tomlnames it.
- repomatic.cli.github.require_token(validator)[source]¶
Run a token validator of
repomatic.github.tokenbefore a command.The validator is read with a late
getattr, so a test patching it on that module after import reaches the command too. A validator raisingRuntimeErrorends the command with its message.
- repomatic.cli.github.thread_options(func)[source]¶
--numberand--pr/--issue, read from the event payload when absent.The thread a command acts on:
resolve_thread()applies the defaults.- Return type:
TypeVar(FC, bound= Callable[…, Any])
- repomatic.cli.github.resolve_thread(number, is_pr)[source]¶
Complete the
thread_options()values from the event payload.- Parameters:
- Return type:
- Returns:
The thread number and kind.
- Raises:
click.UsageError – When neither the option nor the event names a thread.
- repomatic.cli.github.template_options(func)[source]¶
The options that pick a template and feed its arguments.
resolve_template()reads--templateand--template-fileinto one template, andparse_template_args()reads--template-argand--template-arg-fileinto one mapping.- Return type:
TypeVar(FC, bound= Callable[…, Any])
- repomatic.cli.github.resolve_template(template, template_file)[source]¶
The template
--templateor--template-filenames, if either does.- Raises:
click.UsageError – When both are given.
- Return type:
- repomatic.cli.github.parse_template_args(template_args_cli, template_arg_files)[source]¶
Read
--template-argand--template-arg-fileinto one mapping.The files are read after the inline pairs, so a file wins on a key given both ways.
- Raises:
click.UsageError – On a malformed pair, or a file that cannot be read.
- Return type:
