Skip to content

satomic/gitlab-copilot-code-review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Review with GitHub Copilot CLI

English | 中文

A demonstration project showing how to integrate GitHub Copilot CLI with GitLab CI for automated code review.

Overview

This project demonstrates:

  • A Snake game implementation with intentional code quality issues
  • GitLab CI pipeline that runs GitHub Copilot CLI (copilot command) on merge requests
  • Automated posting of AI-generated code review feedback

Key Files

Demo Review Results

See real examples of automated code reviews:

Quick Start

  1. Clone the repository

    git clone https://gitlab.com/YOUR_USERNAME/code-review-with-copilot-cli.git
    cd code-review-with-copilot-cli
  2. Play the game locally

    # Open src/index.html in your browser
    # Or use a local server:
    python -m http.server 8000
    # Visit: http://localhost:8000/src/
  3. Set up GitLab CI Variables

    • Navigate to Settings → CI/CD → Variables
    • Add GITHUB_TOKEN (GitHub Personal Access Token with Copilot access)
    • Add GITLAB_TOKEN (GitLab API token with api scope)
    • Important: Do NOT mark these variables as "Protected", because MR pipelines run on non-protected branches. Protected variables are only available on protected branches (like main/master)
    • Optional: Add REVIEW_LANGUAGE variable to set review language:
      • en (default) - English reviews
      • zh - Chinese reviews
  4. Create a merge request to see the demo

    • Create a feature branch with improvements to the Snake game
    • Push your branch and create a merge request
    • Watch the CI pipeline run and post Copilot review feedback

Project Structure

src/
├── index.html           # Main game page
├── styles/
│   └── game.css        # Game styling
├── scripts/
│   ├── game.js         # Core game logic
│   ├── snake.js        # Snake entity
│   └── utils.js        # Utility functions
└── assets/             # Game assets

.gitlab-ci.yml          # CI configuration
scripts/
└── review-mr.sh        # Copilot review script

Requirements

  • GitLab account with CI/CD access
  • GitHub account with Copilot subscription
  • Modern web browser (Chrome, Firefox, Safari)

License

MIT License - See LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published