-
Notifications
You must be signed in to change notification settings - Fork 207
Closed
Labels
kind/enhancementNew feature or requestNew feature or requestpriority/p2Important but can be addressed in a future releaseImportant but can be addressed in a future release
Description
TL;DR
We need to update the context fetching in PR review workflow to ensure it covers all the conditions
run-gemini-cli/examples/workflows/pr-review/gemini-pr-review.yml
Lines 86 to 145 in fbd9d2f
| ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} | |
| env: | |
| GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' | |
| EVENT_NAME: '${{ github.event_name }}' | |
| WORKFLOW_PR_NUMBER: '${{ github.event.inputs.pr_number }}' | |
| PULL_REQUEST_NUMBER: '${{ github.event.pull_request.number }}' | |
| run: |- | |
| set -euo pipefail | |
| if [[ "${EVENT_NAME}" = "workflow_dispatch" ]]; then | |
| PR_NUMBER="${WORKFLOW_PR_NUMBER}" | |
| else | |
| PR_NUMBER="${PULL_REQUEST_NUMBER}" | |
| fi | |
| echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" | |
| # Get PR details | |
| PR_DATA="$(gh pr view "${PR_NUMBER}" --json title,body,additions,deletions,changedFiles,baseRefName,headRefName)" | |
| echo "pr_data=${PR_DATA}" >> "${GITHUB_OUTPUT}" | |
| # Get file changes | |
| CHANGED_FILES="$(gh pr diff "${PR_NUMBER}" --name-only)" | |
| { | |
| echo "changed_files<<EOF" | |
| echo "${CHANGED_FILES}" | |
| echo "EOF" | |
| } >> "${GITHUB_OUTPUT}" | |
| - name: 'Get PR details (issue_comment)' | |
| id: 'get_pr_comment' | |
| if: |- | |
| ${{ github.event_name == 'issue_comment' }} | |
| env: | |
| GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' | |
| COMMENT_BODY: '${{ github.event.comment.body }}' | |
| PR_NUMBER: '${{ github.event.issue.number }}' | |
| run: |- | |
| set -euo pipefail | |
| echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" | |
| # Extract additional instructions from comment | |
| ADDITIONAL_INSTRUCTIONS="$( | |
| echo "${COMMENT_BODY}" | sed 's/.*@gemini-cli \/review//' | xargs | |
| )" | |
| echo "additional_instructions=${ADDITIONAL_INSTRUCTIONS}" >> "${GITHUB_OUTPUT}" | |
| # Get PR details | |
| PR_DATA="$(gh pr view "${PR_NUMBER}" --json title,body,additions,deletions,changedFiles,baseRefName,headRefName)" | |
| echo "pr_data=${PR_DATA}" >> "${GITHUB_OUTPUT}" | |
| # Get file changes | |
| CHANGED_FILES="$(gh pr diff "${PR_NUMBER}" --name-only)" | |
| { | |
| echo "changed_files<<EOF" | |
| echo "${CHANGED_FILES}" | |
| echo "EOF" | |
| } >> "${GITHUB_OUTPUT}" |
Expected behavior
All conditions have context fetched.
Observed behavior
The following conditions don't seem to have context fetching:
pull_request_review_commentpull_request_review
Action YAML
https://github.com/google-github-actions/run-gemini-cli/blob/fbd9d2f85859e442500bcf1dddd547802d4d63ef/examples/workflows/pr-review/gemini-pr-review.yml#L86-L145Log output
Additional information
No response
Metadata
Metadata
Assignees
Labels
kind/enhancementNew feature or requestNew feature or requestpriority/p2Important but can be addressed in a future releaseImportant but can be addressed in a future release