Skip to content

Commit 534447b

Browse files
authored
fix: remove useless scope_ prefix (#823)
The GitHub outputs is already prefixed by `steps.step-name.scopes.`.
1 parent ac0f2cb commit 534447b

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

mergify_cli/ci/scopes/cli.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
from collections import abc
1919

2020

21-
SCOPE_PREFIX = "scope_"
22-
23-
2421
def match_scopes(
2522
files: abc.Iterable[str],
2623
filters: dict[config.ScopeName, config.FileFilters],
@@ -60,9 +57,8 @@ def maybe_write_github_outputs(
6057
if not gha:
6158
return
6259
with pathlib.Path(gha).open("a", encoding="utf-8") as fh:
63-
for s in sorted(all_scopes):
64-
key = f"{SCOPE_PREFIX}{s}"
65-
val = "true" if s in scopes_hit else "false"
60+
for key in sorted(all_scopes):
61+
val = "true" if key in scopes_hit else "false"
6662
fh.write(f"{key}={val}\n")
6763

6864

mergify_cli/tests/ci/scopes/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ def test_maybe_write_github_outputs(
289289
cli.maybe_write_github_outputs(all_scopes, scopes_hit)
290290

291291
content = output_file.read_text()
292-
assert "scope_backend=true\n" in content
293-
assert "scope_docs=true\n" in content
294-
assert "scope_frontend=false\n" in content
292+
assert "backend=true\n" in content
293+
assert "docs=true\n" in content
294+
assert "frontend=false\n" in content
295295

296296

297297
def test_maybe_write_github_outputs_no_env(

0 commit comments

Comments
 (0)