-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move to docker approach (#3)
The current github action is not work on outside in other github actions. This changes propose to move to docker approach and hope it will fix the problem mentioned above.
- Loading branch information
Showing
7 changed files
with
49 additions
and
25 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,13 @@ | ||
# Container image that runs your code | ||
FROM python:3.8-slim | ||
|
||
# Instalando as dependencias | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
# Copies your code file from your action repository to the filesystem path `/` of the container | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY main.py /main.py | ||
|
||
# Code file to execute when the docker container starts up (`entrypoint.sh`) | ||
ENTRYPOINT ["/entrypoint.sh"] |
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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
# GitHub Actions ChatGPT PR Reviewer | ||
|
||
Requires Python 3.7.1+ | ||
This GitHub actions uses OpenAI ChatGPT in order to review the changes | ||
presented in a PR and will recommend improvements. | ||
|
||
### How to use | ||
|
||
Include the following into your github actions step | ||
|
||
```yaml | ||
- name: GitHub Actions ChatGPT PR Reviewer | ||
uses: osl-incubator/[email protected] | ||
with: | ||
openai_api_key: ${{ secrets.OPENAI_API_KEY }} | ||
openai_model: 'gpt-3.5-turbo' | ||
openai_temperature: 0.5 | ||
openai_max_tokens: 2048 | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_pr_id: ${{ github.event.number }} | ||
``` | ||
Note: this GitHub actions is based on the following tutorial: | ||
https://shipyard.build/blog/your-first-python-github-action/ | ||
|
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
File renamed without changes.
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,10 @@ | ||
#!/bin/bash | ||
|
||
export OPENAI_API_KEY="$1" | ||
export OPENAI_MODEL="$2" | ||
export OPENAI_TEMPERATURE="$3" | ||
export OPENAI_MAX_TOKENS="$4" | ||
export GITHUB_TOKEN="$5" | ||
export GITHUB_PR_ID="$6" | ||
|
||
python /main.py |
File renamed without changes.
File renamed without changes.