modulepackage
0.2.0
Repository: https://github.com/michalswi/github-openai.git
Documentation: pkg.go.dev
# README
github-openai
The Go application utilizes OpenAI's ChatGPT to review all files from the latest commit and subsequently adds comments.
Examples:
- main branch
- develop branch
- github-actions integration - commit, gh-actions
You need:
export API_KEY=<> &&\
export GITHUB_PAT=<> &&\
export REPO_OWNER=<owner> &&\
export REPO_NAME=<repo_name>
# [optional] if branch different than the default one (main)
export BRANCH_NAME=develop
GitHub Actions workflow example
name: github-openai
on:
push:
branches:
- main
jobs:
openai:
runs-on: ubuntu-latest
steps:
- name: wget github-openai binary v0.2.0
run: |
wget https://github.com/michalswi/github-openai/releases/download/v0.2.0/github-openai_linux_amd64
chmod +x github-openai_linux_amd64
- name: run github-openai
env:
API_KEY: ${{ secrets.API_KEY }}
GITHUB_PAT: ${{ secrets.GH_PAT }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.repository }}
run: |
REPO_NAME=$(echo $REPO_NAME | cut -d '/' -f 2)
# export BRANCH_NAME=develop
./github-openai_linux_amd64
# Functions
NewHandlers creates a new Handlers object with the provided logger.