Skip to content

Commit f0f8974

Browse files
committed
fix(ci): Fix Stale Component Removal PR missing owners
- Previously was retrieved after OWNERS file was removed, so script always thought no owners were assigned Signed-off-by: Giulio Frasca <gfrasca@redhat.com>
1 parent d9ba266 commit f0f8974

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.github/scripts/stale_component_handler/stale_component_handler.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ def create_issue_body(component: dict, repo_path: Path) -> str:
9595
)
9696

9797

98-
def create_removal_pr_body(component: dict, repo_path: Path) -> str:
98+
def create_removal_pr_body(component: dict, owners: list[str]) -> str:
9999
"""Generate the PR body for component removal using Jinja2 template."""
100100
env = Environment(loader=FileSystemLoader(TEMPLATE_DIR))
101101
template = env.get_template(REMOVAL_PR_BODY_TEMPLATE)
102102

103-
owners = get_owners(repo_path / component["path"])
104103
owners_mention = ", ".join(f"@{o}" for o in owners) if owners else "No owners found"
105104

106105
return template.render(
@@ -261,8 +260,8 @@ def create_removal_pr(repo: str, component: dict, repo_path: Path, dry_run: bool
261260
# Push the branch
262261
subprocess.run(["git", "push", "-u", "origin", branch_name, "--force"], check=True, capture_output=True)
263262

264-
# Create the PR
265-
body = create_removal_pr_body(component, repo_path)
263+
# Create the PR (use owners read before component was removed)
264+
body = create_removal_pr_body(component, owners)
266265
pr_cmd = [
267266
"gh", "pr", "create",
268267
"--repo", repo,

0 commit comments

Comments
 (0)