Skip to content

Conversation

ChrisCarini
Copy link
Member

Summary

This PR adds a GitHub Actions workflow to automatically request Copilot code reviews for pull requests in linkedin/Liger-Kernel.

Changes

  • Added .github/workflows/automatically-request-copilot-review.yaml
  • The workflow will automatically request Copilot reviews on all PRs

⚠️ ⚠️ ⚠️ ACTION REQUIRED ⚠️ ⚠️ ⚠️

You still need to create a GitHub Personal Access Token (PAT) and add it to the repository secrets for this GitHub repository!

  1. Click here to create a classic GitHub PAT with the correct scopes (repo)
  2. You will need to set a repository secret named GH_TOKEN_COPILOT_REVIEW for all the desired repositories
  3. Once the secret named GH_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:

  1. Checkout the repository
  2. Automatically request a Copilot review using the configured token
    • Note: Whoever created the PAT will show up as the one requesting the review from Copilot.

@shimizust shimizust self-assigned this Sep 16, 2025
@shimizust shimizust marked this pull request as ready for review September 21, 2025 20:18
@shimizust
Copy link
Collaborator

Thank you! Added the github pat token

shimizust
shimizust previously approved these changes Sep 21, 2025
Copy link

@Copilot Copilot AI left a 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 }}
Copy link

Copilot AI Sep 21, 2025

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.

Suggested change
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
Copy link

Copilot AI Sep 21, 2025

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.

Suggested change
run: gh extension install ChrisCarini/gh-copilot-review
run: gh extension install ChrisCarini/gh-copilot-review --pin

Copilot uses AI. Check for mistakes.

@shimizust
Copy link
Collaborator

@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: gh copilot-review https://github.com/linkedin/Liger-Kernel/pull/877

The secret isn't being passed to the workflow for prs originating from forks. Any ideas?

@ChrisCarini
Copy link
Member Author

@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: gh copilot-review https://github.com/linkedin/Liger-Kernel/pull/877

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants