mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 01:56:47 +00:00
Merge pull request #1 from cds-snc/cds-initialization
Cds initialization
This commit is contained in:
commit
4ed9c34b32
5 changed files with 46 additions and 15 deletions
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
# Summary | Résumé
|
||||
|
||||
|
||||
> 1-3 sentence description of the changed you're proposing, including a link to
|
||||
> a GitHub Issue # or Trello card if applicable.
|
||||
|
||||
---
|
||||
|
||||
> Description en 1 à 3 phrases de la modification proposée, avec un lien vers le
|
||||
> problème (« issue ») GitHub ou la fiche Trello, le cas échéant.
|
||||
|
||||
> **Note**: Ajoutez vous une nouvelle page par Articles GC? Assurez vous d'ajouter le chemin dans les [règles WAF](https://github.com/cds-snc/notification-utils/tree/main/.github/actions/waffles#supporting-a-new-url-within-gcnotify).
|
||||
|
||||
# Test instructions | Instructions pour tester la modification
|
||||
|
||||
> Sequential steps (1., 2., 3., ...) that describe how to test this change. This
|
||||
> will help a developer test things out without too much detective work. Also,
|
||||
> include any environmental setup steps that aren't in the normal README steps
|
||||
> and/or any time-based elements that this requires.
|
||||
|
||||
---
|
||||
|
||||
> Étapes consécutives (1., 2., 3., …) qui décrivent la façon de tester la
|
||||
> modification. Elles aideront les développeurs à faire des tests sans avoir à
|
||||
> jouer au détective. Veuillez aussi inclure toutes les étapes de configuration
|
||||
> de l’environnement qui ne font pas partie des étapes normales dans le fichier
|
||||
> README et tout élément temporel requis.
|
4
.github/workflows/code_review.yml
vendored
4
.github/workflows/code_review.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Code Review with OpenAI
|
||||
name: CDS Code Review with OpenAI
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
|
@ -12,7 +12,7 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Code Review
|
||||
uses: freeedcom/ai-codereviewer@main
|
||||
uses: cds-snc/cds-ai-codereviewer@main
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
|
21
README.md
21
README.md
|
@ -1,6 +1,6 @@
|
|||
# AI Code Reviewer
|
||||
# CDS AI Code Reviewer
|
||||
|
||||
AI Code Reviewer is a GitHub Action that leverages OpenAI's GPT-4 API to provide intelligent feedback and suggestions on
|
||||
CDS AI Code Reviewer is a GitHub Action that leverages OpenAI's GPT-4 API to provide intelligent feedback and suggestions on
|
||||
your pull requests. This powerful tool helps improve code quality and saves developers time by automating the code
|
||||
review process.
|
||||
|
||||
|
@ -22,7 +22,7 @@ review process.
|
|||
3. Create a `.github/workflows/main.yml` file in your repository and add the following content:
|
||||
|
||||
```yaml
|
||||
name: AI Code Reviewer
|
||||
name: CDS AI Code Reviewer
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -37,8 +37,8 @@ jobs:
|
|||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: AI Code Reviewer
|
||||
uses: your-username/ai-code-reviewer@main
|
||||
- name: CDS AI Code Reviewer
|
||||
uses: cds-snc/cds-ai-code-reviewer@main
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The GITHUB_TOKEN is there by default so you just need to keep it like it is and not necessarily need to add it as secret as it will throw an error. [More Details](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
@ -46,21 +46,18 @@ jobs:
|
|||
exclude: "**/*.json, **/*.md" # Optional: exclude patterns separated by commas
|
||||
```
|
||||
|
||||
4. Replace `your-username` with your GitHub username or organization name where the AI Code Reviewer repository is
|
||||
located.
|
||||
4. Customize the `exclude` input if you want to ignore certain file patterns from being reviewed.
|
||||
|
||||
5. Customize the `exclude` input if you want to ignore certain file patterns from being reviewed.
|
||||
|
||||
6. Commit the changes to your repository, and AI Code Reviewer will start working on your future pull requests.
|
||||
5. Commit the changes to your repository, and CDS AI Code Reviewer will start working on your future pull requests.
|
||||
|
||||
## How It Works
|
||||
|
||||
The AI Code Reviewer GitHub Action retrieves the pull request diff, filters out excluded files, and sends code chunks to
|
||||
The CDS AI Code Reviewer GitHub Action retrieves the pull request diff, filters out excluded files, and sends code chunks to
|
||||
the OpenAI API. It then generates review comments based on the AI's response and adds them to the pull request.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please feel free to submit issues or pull requests to improve the AI Code Reviewer GitHub
|
||||
Contributions are welcome! Please feel free to submit issues or pull requests to improve the CDS AI Code Reviewer GitHub
|
||||
Action.
|
||||
|
||||
Let the maintainer generate the final package (`yarn build` & `yarn package`).
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name: "AI Code Review Action"
|
||||
name: "CDS AI Code Review Action"
|
||||
description: "Perform code reviews and comment on diffs using OpenAI API."
|
||||
inputs:
|
||||
GITHUB_TOKEN:
|
||||
|
|
6
renovate.json
Normal file
6
renovate.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>cds-snc/renovate-config"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue