Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michalswi/github-openai
OpenAI (ChatGPT) integration with GitHub
https://github.com/michalswi/github-openai
chatgpt chatgpt-api cicd github-actions github-ai github-api openai openai-api
Last synced: 5 days ago
JSON representation
OpenAI (ChatGPT) integration with GitHub
- Host: GitHub
- URL: https://github.com/michalswi/github-openai
- Owner: michalswi
- Created: 2024-04-30T12:49:07.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-07T12:35:27.000Z (8 months ago)
- Last Synced: 2024-05-08T09:53:59.073Z (8 months ago)
- Topics: chatgpt, chatgpt-api, cicd, github-actions, github-ai, github-api, openai, openai-api
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-openai
![](https://img.shields.io/github/stars/michalswi/github-openai)
![](https://img.shields.io/github/issues/michalswi/github-openai)
![](https://img.shields.io/github/forks/michalswi/github-openai)
![](https://img.shields.io/github/last-commit/michalswi/github-openai)
![](https://img.shields.io/github/release/michalswi/github-openai)The Go application utilizes OpenAI's ChatGPT to review all files from the latest commit and subsequently adds comments.
Examples:
- [main](https://github.com/michalswi/github-openai-test/commit/684842f1c83edce4c0f8cd12b545ab8febf97891#comments) branch
- [develop](https://github.com/michalswi/github-openai-test/commit/3938a0d2482b325df367c824d3ded1bed8c307a9#comments) branch
- github-actions integration - [commit](https://github.com/michalswi/github-openai-test/commit/4467c7b457e6357ea6d7b924a66a4163b39b1301), [gh-actions](https://github.com/michalswi/github-openai-test/actions/runs/8984096714)You need:
- [OpenAI API key](https://platform.openai.com/api-keys)
- [GitHub Personal Token](https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens)```
export API_KEY=<> &&\
export GITHUB_PAT=<> &&\
export REPO_OWNER= &&\
export REPO_NAME=# [optional] if branch different than the default one (main)
export BRANCH_NAME=develop
```#### GitHub Actions workflow example
```
name: github-openaion:
push:
branches:
- mainjobs:
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
```