Skip to content

Commit

Permalink
Merge pull request #22 from LukaszSielski/extract_commons
Browse files Browse the repository at this point in the history
test
  • Loading branch information
LukaszSielski authored Sep 19, 2024
2 parents 8263e53 + 77eb375 commit def19bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/gh_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ def extract_pr_body(self, commit_sha: str) -> str:
except subprocess.CalledProcessError as e:
raise Exception(f'Failed to retrieve PR body! {e.stderr}')
prDetailsJson = json.loads(prDetails)
print(prDetailsJson)
return prDetailsJson[0]['body'] if len(prDetailsJson) == 0 else ''

T = TypeVar('T')
def extract_data_from_pr_body(self, commit_sha: str, pattern: re.Pattern, mapping: Callable[[str], T]) -> list[T]:
finds = re.findall(pattern, self.extract_pr_body(commit_sha))
print(finds)
a = list(map(mapping, finds))
print(a)
return a
Expand Down

0 comments on commit def19bc

Please sign in to comment.