Add automatically-request-copilot-review.yaml workflow#877
Add automatically-request-copilot-review.yaml workflow#877ChrisCarini wants to merge 9 commits intolinkedin:mainfrom
automatically-request-copilot-review.yaml workflow#877Conversation
|
Thank you! Added the github pat token |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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 }} |
| - name: Install gh-copilot-review extension | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: gh extension install ChrisCarini/gh-copilot-review |
There was a problem hiding this comment.
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 |
|
@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.yamlYou still need to create a GitHub Personal Access Token (PAT) and add it to the repository secrets for this GitHub repository!
repo)Expirationvalue you feel is reasonable from a usability + security perspective given the necessary scopes and usage.GH_TOKEN_COPILOT_REVIEWfor all the desired repositoriesGH_TOKEN_COPILOT_REVIEWis 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: