Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 3abb897

Browse files
authored
add prettierc (#9)
- Adds Prettier configuration file for consistent code formatting. - Updates README with more details on features, environment variables, inputs, and development sections. - Includes instructions on how to choose between ChatGPT API implementations and how to inspect messages between ChatGPT server.
1 parent c0e847f commit 3abb897

File tree

2 files changed

+43
-23
lines changed

2 files changed

+43
-23
lines changed

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSameLine": true,
4+
"printWidth": 80,
5+
"proseWrap": "always",
6+
"trailingComma": "all"
7+
}

README.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
## Overview
66

7-
This [ChatGPT](https://platform.openai.com/docs/guides/chat) based GitHub Action provides a summary, release notes and review of pull requests. The prompts have been tuned for concise response. To prevent excessive notifications, this action can be configured to skip adding review comments when the changes look good for the most part.
7+
This [ChatGPT](https://platform.openai.com/docs/guides/chat) based GitHub Action
8+
provides a summary, release notes and review of pull requests. The prompts have
9+
been tuned for a concise response. To prevent excessive notifications, this
10+
action can be configured to skip adding review comments when the changes look
11+
good for the most part.
812

913
### Features
1014

@@ -67,22 +71,25 @@ See also: [./action.yml](./action.yml)
6771
#### Environment variables
6872
6973
- `GITHUB_TOKEN`
70-
- `CHATGPT_ACCESS_TOKEN`: ChatGPT access token, see also: https://github.com/acheong08/ChatGPT.
74+
- `CHATGPT_ACCESS_TOKEN`: ChatGPT access token, see also:
75+
https://github.com/acheong08/ChatGPT.
7176

72-
The access token can be easily obtained from https://chat.openai.com/api/auth/session after
73-
logging into ChatGPT.
77+
The access token can be easily obtained from
78+
https://chat.openai.com/api/auth/session after logging into ChatGPT.
7479

75-
- `OPENAI_API_KEY`: use this to authenticate with OpenAI API, official ChatGPT's behavior using
76-
`gpt-3.5-turbo`, see also: https://github.com/transitive-bullshit/chatgpt-api
80+
- `OPENAI_API_KEY`: use this to authenticate with OpenAI API, official ChatGPT's
81+
behavior using `gpt-3.5-turbo`, see also:
82+
https://github.com/transitive-bullshit/chatgpt-api
7783

78-
Note that `CHATGPT_ACCESS_TOKEN` and `OPENAI_API_KEY` are not both required. Inside this action,
79-
unofficial ChatGPT is preferred if `CHATGPT_ACCESS_TOKEN` exists. Note that the `CHATGPT_ACCESS_TOKEN`
80-
can expire frequently, so `OPENAI_API_KEY` should be more convenient if its cost is affordable
81-
to you.
84+
Note that `CHATGPT_ACCESS_TOKEN` and `OPENAI_API_KEY` are not both required.
85+
Inside this action, unofficial ChatGPT is preferred if `CHATGPT_ACCESS_TOKEN`
86+
exists. Note that the `CHATGPT_ACCESS_TOKEN` can expire frequently, so
87+
`OPENAI_API_KEY` should be more convenient if its cost is affordable to you.
8288

8389
#### Inputs
8490

85-
- `debug`: Enable debug mode, will show messages and responses between ChatGPT server in CI logs.
91+
- `debug`: Enable debug mode, will show messages and responses between ChatGPT
92+
server in CI logs.
8693
- `chatgpt_reverse_proxy`: The URL of the ChatGPT reverse proxy
8794
- `review_comment_lgtm`: Leave comments even the patch is LGTM
8895
- `path_filters`: Rules to filter files to be reviewed.
@@ -93,11 +100,13 @@ to you.
93100

94101
See: [./action.yml](./action.yml)
95102

96-
Any suggestions or pull requests for improving the prompts are highly appreciated.
103+
Any suggestions or pull requests for improving the prompts are highly
104+
appreciated.
97105

98106
## Developing
99107

100-
> First, you'll need to have a reasonably modern version of `node` handy, tested with node 16.
108+
> First, you'll need to have a reasonably modern version of `node` handy, tested
109+
> with node 16.
101110

102111
Install the dependencies
103112

@@ -148,33 +157,37 @@ jobs:
148157
debug: false
149158
```
150159

151-
See also: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
160+
See also:
161+
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
152162

153163
### Choose the ChatGPT API implementation
154164

155-
The javascript's [chatgpt][2] package provides two implementations of the ChatGPT API:
165+
The javascript's [chatgpt][2] package provides two implementations of the
166+
ChatGPT API:
156167

157168
- `ChatGPTAPI`: official ChatGPT using the OpenAI's `gpt-3.5-turbo`.
158169
- not free
159170
- requires `OPENAI_API_KEY`
160-
- `ChatGPTUnofficialProxyAPI`: unofficial ChatGPT models, rely on third-party server and is
161-
rate limited.
171+
- `ChatGPTUnofficialProxyAPI`: unofficial ChatGPT models, rely on third-party
172+
server and is rate limited.
162173
- free
163174
- requires `CHATGPT_ACCESS_TOKEN`
164175
- the proxy server is configurable using `chatgpt_reverse_proxy`
165176

166-
If both environment variables `OPENAI_API_KEY` and `CHATGPT_ACCESS_TOKEN` exists, we
167-
prefer the `ChatGPTUnofficialProxyAPI` implementation.
177+
If both environment variables `OPENAI_API_KEY` and `CHATGPT_ACCESS_TOKEN`
178+
exists, we prefer the `ChatGPTUnofficialProxyAPI` implementation.
168179

169180
### Inspect the messages between ChatGPT server
170181

171-
Set `debug: true` in the workflow file to enable debug mode, which will show the messages
182+
Set `debug: true` in the workflow file to enable debug mode, which will show the
183+
messages
172184

173-
[1]: https://github.com/marketplace?type=&verification=&query=chatgpt-pr-reviewer+
185+
[1]:
186+
https://github.com/marketplace?type=&verification=&query=chatgpt-pr-reviewer+
174187
[2]: https://www.npmjs.com/package/chatgpt
175188

176189
### Special Thanks
177190

178191
This GitHub Action is based on
179-
[ChatGPT Action](https://github.com/unsafecoerce/chatgpt-action)
180-
by [Tao He](https://github.com/sighingnow).
192+
[ChatGPT Action](https://github.com/unsafecoerce/chatgpt-action) by
193+
[Tao He](https://github.com/sighingnow).

0 commit comments

Comments
 (0)