-
Notifications
You must be signed in to change notification settings - Fork 415
Add automatically-request-copilot-review.yaml
workflow
#877
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
Thank you! Added the github pat token |
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 adds a GitHub Actions workflow to automatically request Copilot code reviews for all pull requests in the linkedin/Liger-Kernel repository. The workflow triggers on PR events (opened, ready_for_review, reopened, synchronize) and uses a third-party GitHub CLI extension to request Copilot reviews.
- Automated Copilot review requests for all non-draft PRs
- Integration with ChrisCarini/gh-copilot-review extension
- Configuration requiring a GitHub Personal Access Token with repo scope
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
steps: | ||
- name: Install gh-copilot-review extension | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
Copilot
AI
Sep 21, 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.
Using github.token
for installing third-party extensions may have insufficient permissions. The default GITHUB_TOKEN
has limited scope and may not work reliably for extension installation. Consider using the same GH_TOKEN_COPILOT_REVIEW
secret for consistency, or document the specific permissions required for the default token.
GH_TOKEN: ${{ github.token }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN_COPILOT_REVIEW }} |
Copilot uses AI. Check for mistakes.
- name: Install gh-copilot-review extension | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: gh extension install ChrisCarini/gh-copilot-review |
Copilot
AI
Sep 21, 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.
Installing a third-party extension without version pinning poses security risks. The extension could be updated with malicious code between workflow runs. Consider pinning to a specific version or commit hash, such as gh extension install ChrisCarini/gh-copilot-review --pin
.
run: gh extension install ChrisCarini/gh-copilot-review | |
run: gh extension install ChrisCarini/gh-copilot-review --pin |
Copilot uses AI. Check for mistakes.
@ChrisCarini I'm having trouble getting this to work. I added the gh pat, but it is failing to request the review. On local, I can successfully trigger the review: The secret isn't being passed to the workflow for prs originating from forks. Any ideas? |
@shimizust - Since you created an environment to be used, I believe you need to set the secret/PAT there. I don't currently see one set there, but I do in actions - try moving the secret to the environment you created. |
Summary
This PR adds a GitHub Actions workflow to automatically request Copilot code reviews for pull requests in linkedin/Liger-Kernel.
Changes
.github/workflows/automatically-request-copilot-review.yaml
You still need to create a GitHub Personal Access Token (PAT) and add it to the repository secrets for this GitHub repository!
repo
)Expiration
value you feel is reasonable from a usability + security perspective given the necessary scopes and usage.GH_TOKEN_COPILOT_REVIEW
for all the desired repositoriesGH_TOKEN_COPILOT_REVIEW
is added, please merge in the PR after getting the necessary approval(s).How it works
When a pull request is opened or updated in the linkedin/Liger-Kernel product, this workflow will: