Skip to content
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

Add cr bot #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright 2023 Apollo Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [ opened, reopened, synchronize ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code patch appears to be a GitHub Actions workflow for automating code review using the ChatGPT-CodeReview action. Here are some observations:

  • The license and copyright information is provided, which is good practice.
  • The workflow is triggered on pull request events of type opened, reopened, or synchronized, which suggests that it will run on every pull request update.
  • There is a single job called "test" that runs on Ubuntu latest.
  • The only step in this job is to use the anc95/ChatGPT-CodeReview@main action, which requires secrets.GITHUB_TOKEN and secrets.OPENAI_API_KEY.
  • There are no other steps such as Maven build, test, or deployment, which might indicate that they are handled elsewhere.

Potential improvements:

  • It may be a good idea to add additional jobs or steps for testing, building, or deploying the application.
  • It is good practice to limit the scope of permissions to only what is required by the workflow. In this case, repository access is not required, so pull-requests:write permission can be removed.
  • Providing more detailed information about how the automated code review works could be helpful for other contributors.