Skip to content

Commit 98e7637

Browse files
silehtclaude
andcommitted
feat(ci): add --config option and MERGIFY_CONFIG envvar to git-refs and scopes
Allow passing the mergify config file path via --config flag or MERGIFY_CONFIG environment variable for both ci git-refs and ci scopes commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Change-Id: Ide4525c9098103cd36627bf592518ba11c8d9c9c
1 parent 89878c9 commit 98e7637

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

mergify_cli/ci/cli.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ async def junit_process(
204204
help="""Give the base/head git references of the pull request""",
205205
short_help="""Give the base/head git references of the pull request""",
206206
)
207-
def git_refs() -> None:
207+
@click.option(
208+
"--config",
209+
"config_path",
210+
type=click.Path(),
211+
envvar="MERGIFY_CONFIG",
212+
default=detector.get_mergify_config_path,
213+
help="Path to YAML config file.",
214+
)
215+
def git_refs(config_path: str | None) -> None:
208216
ref = git_refs_detector.detect()
209217
click.echo(f"Base: {ref.base}")
210218
click.echo(f"Head: {ref.head}")
@@ -219,6 +227,7 @@ def git_refs() -> None:
219227
"--config",
220228
"config_path",
221229
type=click.Path(),
230+
envvar="MERGIFY_CONFIG",
222231
default=detector.get_mergify_config_path,
223232
help="Path to YAML config file.",
224233
)

0 commit comments

Comments
 (0)