Skip to content

Commit 32a1d86

Browse files
authored
Merge pull request #28 from hrshdhgd/process-by-label
Process by label and number both
2 parents 3484fbd + 7c1f217 commit 32a1d86

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

src/onto_crawler/cli.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,32 @@ def process_issue(
153153
new_output = output
154154
else:
155155
new_output = input
156-
157-
process_issue_via_oak(
158-
input=input,
159-
body=issue[BODY],
160-
output=new_output,
156+
157+
label_names = [label['name'] for label in issue['labels']]
158+
159+
if label in label_names and issue['number'] == number:
160+
process_issue_via_oak(
161+
input=input,
162+
body=issue[BODY],
163+
output=new_output,
164+
)
165+
166+
formatted_body += _list_to_markdown(issue[BODY])
167+
168+
click.echo(
169+
f"""
170+
::set-output name=PR_BODY::{formatted_body}
171+
::set-output name=PR_TITLE::{issue[TITLE]}
172+
"""
173+
)
174+
break
175+
else:
176+
click.echo(
177+
f"""
178+
{issue[TITLE]} does not need the bot's attention.
179+
"""
161180
)
162181

163-
formatted_body += _list_to_markdown(issue[BODY])
164-
165-
click.echo(
166-
f"""
167-
::set-output name=PR_BODY::{formatted_body}
168-
::set-output name=PR_TITLE::{issue[TITLE]}
169-
"""
170-
)
171-
172182

173183
def _list_to_markdown(list: list) -> str:
174184
bullet = "- "

0 commit comments

Comments
 (0)