-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): add GitHub Copilot CLI installation and review for pull re… #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates GitHub Copilot CLI into the CI workflow to provide automated code review for pull requests. It adds the necessary permissions and CI steps to install, configure, and execute Copilot CLI reviews with Japanese output.
- Added
pull-requests: readpermission to enable Copilot CLI access to PR information - Integrated GitHub Copilot CLI installation and configuration steps that run only on pull requests
- Automated PR review generation with output appended to workflow summary
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| REVIEW_URL="https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" | ||
| copilot -p "Check the changes made in PR ${REVIEW_URL}. Identify critical bugs, test gaps, and security concerns. Summarize your findings with sections for Summary, Risks, and Suggested Actions. Always Respond in Japanese." > copilot-review.md |
Copilot
AI
Sep 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command syntax is incorrect for GitHub Copilot CLI. The correct command should be gh copilot suggest or similar, as Copilot CLI is typically accessed through the GitHub CLI (gh) tool, not as a standalone copilot command.
| copilot -p "Check the changes made in PR ${REVIEW_URL}. Identify critical bugs, test gaps, and security concerns. Summarize your findings with sections for Summary, Risks, and Suggested Actions. Always Respond in Japanese." > copilot-review.md | |
| gh copilot review --url "$REVIEW_URL" --prompt "Check the changes made in PR ${REVIEW_URL}. Identify critical bugs, test gaps, and security concerns. Summarize your findings with sections for Summary, Risks, and Suggested Actions. Always Respond in Japanese." > copilot-review.md |
| if [ -f "$CONFIG_FILE" ]; then | ||
| tmp_file="$(mktemp)" | ||
| jq --arg dir "$WORKSPACE_PATH" ' | ||
| .trusted_folders = (.trusted_folders // []) | | ||
| if (.trusted_folders | index($dir)) == null then | ||
| .trusted_folders += [$dir] | ||
| else | ||
| . | ||
| end | ||
| ' "$CONFIG_FILE" > "$tmp_file" | ||
| mv "$tmp_file" "$CONFIG_FILE" |
Copilot
AI
Sep 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses jq without ensuring it's installed. GitHub Actions runners may not have jq pre-installed, which would cause this step to fail. Consider installing jq first or using a different approach for JSON manipulation.
…nvironment variable
…quests
This pull request updates the CI workflow to integrate automated code review using GitHub Copilot CLI for pull requests. It adds permissions and steps to install, configure, and run Copilot CLI, ensuring reviews are generated and included in the workflow summary.
CI workflow enhancements
pull-requests: readpermission to the CI workflow to allow Copilot CLI to access pull request information.GitHub Copilot CLI integration