Skip to content

Commit

Permalink
port code from personal repo
Browse files Browse the repository at this point in the history
  • Loading branch information
awgraves committed May 5, 2023
1 parent 7607b7d commit 2a35c52
Show file tree
Hide file tree
Showing 7 changed files with 10,368 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# openai-moderation-action
From Spring 2023 Hackathon - sends file content along with hard-coded prompt to openai and returns the response
# ai-moderation-comment-action

For local dev you need to install ncc bundler tool:
`install npm i -g @vercel/ncc`

Then after making any changes, you need to run the following command before pushing:
`ncc build index.js`

This will combine your code + all the dependencies in node_modules into a single .js file in the dist dir.

Its important to have a single file otherwise the action may not work correctly (per official github docs on custom JS actions).
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Docs AI Moderation Comment'
description: 'Takes list of file paths and returns AI moderation comment'
inputs:
OPEN_AI_API_KEY:
description: 'API key to access the AI'
required: true
filepaths:
description: 'String of file paths separated by spaces'
required: true
outputs:
message:
description: 'The response from the AI'
runs:
using: 'node16'
main: 'dist/index.js'

Loading

0 comments on commit 2a35c52

Please sign in to comment.