Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ jobs:
id: get_diff
shell: bash
env:
DEFAULT_BRANCH: "${{ github.event.repository.default_branch }}"
PULL_REQUEST_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
run: |-
git fetch origin "${{ env.PULL_REQUEST_HEAD_REF }}:${{ env.PULL_REQUEST_HEAD_REF }}"
git checkout "${{ env.PULL_REQUEST_HEAD_REF }}"
git diff "origin/${{ env.PULL_REQUEST_HEAD_REF }}" > "diff.txt"
# Fetch the default branch
git fetch origin "${{ env.DEFAULT_BRANCH }}"
# Exclude png files from diff
git diff "origin/${{ env.DEFAULT_BRANCH }}" ":(exclude)*.png" > "diff.txt"
# Put multi-line string into an environment variable
# shellcheck disable=SC2086
echo "diff=$(cat "diff.txt")" >> $GITHUB_ENV
{
echo "pull_request_diff<<EOF";
cat "diff.txt";
echo 'EOF';
} >> $GITHUB_OUTPUT

- name: Groq Code Review
uses: rajsinghparihar/llm-code-review@v0.0.1-groq
Expand Down