Skip to content

Commit

Permalink
⚙️ Update AI code review workflow
Browse files Browse the repository at this point in the history
The AI code review workflow has been updated to improve logging and error handling.

- The log output is now stored in a variable before being written to the GitHub output.
- The step that adds a comment with the log only runs if both the review step fails and getting the log succeeds.
  • Loading branch information
Corantin committed Oct 17, 2024
1 parent 1c4123d commit 546770c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ai-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gemini_log=$(gh run view ${{ github.run_id }} --log)
echo "gemini_log<<EOF" >> $GITHUB_OUTPUT
gh run view ${{ steps.review.outputs.run_id }} --log >> $GITHUB_OUTPUT
echo "$gemini_log" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Add comment with log
if: steps.review.outcome == 'failure'
if: steps.review.outcome == 'failure' && steps.get-gemini-log.outcome == 'success'
uses: actions/github-script@v6
with:
script: |
Expand Down

0 comments on commit 546770c

Please sign in to comment.