diff options
| author | Jose Santiago Vales Mena <[email protected]> | 2025-07-14 10:22:47 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-14 10:22:47 -0700 |
| commit | 5d1436ef4ca2ebd9a7f89daa4ebb1fe19985d2b3 (patch) | |
| tree | 63d8956fd0be23dc5a421f696d1efeafbf4da450 | |
| parent | ba50875644d06277ac980391e8ab5895b3e87ec6 (diff) | |
| parent | 4c463c36efa37f9e5ab5acaec52e153abc090dcb (diff) | |
Merge pull request #8 from 5an7y/sample-based-issue-template
Made the query more efficient
| -rw-r--r-- | .github/workflows/tag-codeowner-on-issue.yml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/.github/workflows/tag-codeowner-on-issue.yml b/.github/workflows/tag-codeowner-on-issue.yml index 088500d7..eb9c0523 100644 --- a/.github/workflows/tag-codeowner-on-issue.yml +++ b/.github/workflows/tag-codeowner-on-issue.yml @@ -46,7 +46,7 @@ jobs: with open(".github/CODEOWNERS", "r") as f: lines = f.readlines() - codeowners = {} + codeowner = None sample_section = False for line in lines: line = line.strip() @@ -57,15 +57,16 @@ jobs: if line.startswith("#") or not line: continue path, owner = line.split() - codeowners[path] = owner + if path == selected_path: + codeowner = owner + break - owner = codeowners.get(selected_path) - if not owner: + if codeowner is None: print(f"No codeowner found for path: {selected_path}") exit(0) # Post a comment tagging the owner - comment = f"{owner} can you please take a look at this issue related to `{selected_path}`?" + comment = f"{codeowner} can you please take a look at this issue related to `{selected_path}`?" issue_number = os.environ['GITHUB_REF'].split('/')[-1] repo = os.environ['GITHUB_REPOSITORY'] token = os.environ['GITHUB_TOKEN'] |
