Skip to content

Commit

Permalink
Merge pull request #28 from hrshdhgd/process-by-label
Browse files Browse the repository at this point in the history
Process by label and number both
  • Loading branch information
hrshdhgd authored Sep 29, 2022
2 parents 3484fbd + 7c1f217 commit 32a1d86
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions src/onto_crawler/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,32 @@ def process_issue(
new_output = output
else:
new_output = input

process_issue_via_oak(
input=input,
body=issue[BODY],
output=new_output,

label_names = [label['name'] for label in issue['labels']]

if label in label_names and issue['number'] == number:
process_issue_via_oak(
input=input,
body=issue[BODY],
output=new_output,
)

formatted_body += _list_to_markdown(issue[BODY])

click.echo(
f"""
::set-output name=PR_BODY::{formatted_body}
::set-output name=PR_TITLE::{issue[TITLE]}
"""
)
break
else:
click.echo(
f"""
{issue[TITLE]} does not need the bot's attention.
"""
)

formatted_body += _list_to_markdown(issue[BODY])

click.echo(
f"""
::set-output name=PR_BODY::{formatted_body}
::set-output name=PR_TITLE::{issue[TITLE]}
"""
)


def _list_to_markdown(list: list) -> str:
bullet = "- "
Expand Down

0 comments on commit 32a1d86

Please sign in to comment.