-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from mattzcarey/feat/github-marketplace-action
feat: first attempt at custom github action plus test workflow
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: 'Code Review GPT' | ||
description: 'Reviews the staged files with a GPT model from OpenAI' | ||
author: 'Orion Tools' | ||
inputs: | ||
MODEL: | ||
description: 'The GPT model to use' | ||
required: true | ||
default: 'gpt-3.5-turbo' | ||
OPENAI_API_KEY: | ||
description: 'OpenAI API Key' | ||
required: true | ||
GITHUB_TOKEN: | ||
description: 'Github token' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Code Review GPT | ||
shell: bash | ||
run: npm install code-review-gpt | ||
|
||
- name: Run Code Review GPT | ||
shell: bash | ||
run: npx code-review-gpt review --ci=github --model=$MODEL | ||
|
||
env: | ||
MODEL: ${{ inputs.MODEL }} | ||
OPENAI_API_KEY: ${{ inputs.OPENAI_API_KEY }} | ||
BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} |