Skip to content

Commit

Permalink
first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Aug 8, 2024
1 parent 6ae9f05 commit 4b957ae
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,24 @@ jobs:
except subprocess.CalledProcessError:
return "" # Return empty string if file doesn't exist in that ref
def get_file_patch(file_path):
try:
return subprocess.check_output(['git', 'diff', 'HEAD^', 'HEAD', '--', file_path], text=True)
except subprocess.CalledProcessError:
return ""
changed_files = '${{ steps.changed-files.outputs.all_changed_files }}'.split()
file_data = []
for file in changed_files:
original_content = get_file_content(file, 'HEAD^')
changed_content = get_file_content(file, 'HEAD')
patch = get_file_patch(file)
file_data.append({
"filename": file,
"originalContent": original_content,
"changedContent": changed_content
"changedContent": changed_content,
"patch": patch
})
print("XXX", changed_files)
Expand Down

0 comments on commit 4b957ae

Please sign in to comment.