Skip to content

Commit

Permalink
Update review.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreGode authored Dec 10, 2024
1 parent f525322 commit 9919858
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
import requests
import json
# Helper function to extract valid line numbers
def extract_line_number(line_info):
try:
return int(line_info.split(" ")[1]) # Extract integer after "Line"
except (IndexError, ValueError):
return None # Return None if conversion fails
# Gather GitHub event details
event_path = os.environ.get('GITHUB_EVENT_PATH')
with open(event_path, 'r') as f:
Expand Down Expand Up @@ -79,8 +86,9 @@ jobs:
line_info = parts[0].strip()
description = ":".join(parts[1:]).strip()
if "Line" in line_info:
line_number = int(line_info.split(" ")[1]) # Extract line number
# Extract valid line number
line_number = extract_line_number(line_info)
if line_number is not None:
inline_comments.append({
"path": filename,
"line": line_number,
Expand Down

0 comments on commit 9919858

Please sign in to comment.