Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 25, 2024
1 parent b71f176 commit 5e39c45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/gh_scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ A configuration file is required for this script to run properly. The file shou

`leads.leadLabel`: Text of the lead's `Lead: @` label.

`leads.slackId`: The lead's Slack ID in their `mrkdwn` format, which is used to trigger Slack
`leads.slackId`: The lead's Slack ID in their `mrkdwn` format, which is used to trigger Slack


__Running the script locally:__
Expand Down
14 changes: 11 additions & 3 deletions scripts/gh_scripts/issue_comment_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,14 @@ def comment_on_thread(message: str):
commenter = i['commenter']
message = f'<{comment_url}|Latest comment for: *{issue_title}*>\n'

username = next(lead['githubUsername'] for lead in leads if lead['leadLabel'] == i['lead_label'])
slack_id = next(lead['slackId'] for lead in leads if lead['leadLabel'] == username)
username = next(
lead['githubUsername']
for lead in leads
if lead['leadLabel'] == i['lead_label']
)
slack_id = next(
lead['slackId'] for lead in leads if lead['leadLabel'] == username
)
if slack_id:
message += f'Lead: {slack_id}\n'
elif i['lead_label']:
Expand Down Expand Up @@ -274,7 +280,9 @@ def start_job(args: argparse.Namespace):
add_label_to_issues(filtered_issues)
print('Issues labeled as "Needs: Response"')
if args.slack_token and args.channel:
publish_digest(filtered_issues, args.channel, args.slack_token, args.hours, leads)
publish_digest(
filtered_issues, args.channel, args.slack_token, args.hours, leads
)
print('Digest posted to Slack')
if args.verbose:
verbose_output(filtered_issues)
Expand Down

0 comments on commit 5e39c45

Please sign in to comment.