gitea-code-review-action/action.yaml
2023-05-07 06:18:45 +05:30

62 lines
1.8 KiB
YAML

name: Gitea Code Review
description: A GitHub Action that uses OpenAI to review code in pull request.
inputs:
PROGRAMMING_LANGUAGE:
description: 'The programming language used in the GitHub repository. If not provided, the detected programming language will be used.'
default: ''
FULL_REVIEW_COMMENT:
description: 'The comment to trigger a code review for the pull request.'
default: 'openai'
REVIEW_COMMENT_PREFIX:
description: 'The comment prefix to trigger a code review with the comment content.'
default: 'openai:'
OPENAI_TOKEN:
description: 'The API token for the OpenAI API.'
required: true
GITHUB_TOKEN:
description: 'The API token for the Github API.'
required: true
GITHUB_BASE_URL:
description: 'The base URL for the GitHub API.'
MAX_CODE_LENGTH:
description: 'The maximum code length for the pull request to be sent to OpenAI.'
default: 6000
type: int
SOURCE_AT:
description: 'Where is the source code located'
default: 'github'
PROMPT_TEMPLATE:
description: 'The template for the FULL_REVIEW_COMMENT prompt.'
default: 'Please analyze the pull request''s code and provide me an explanation for your decision in bullet points. Also provide me whether it requires optimization or code correction:
\`\`\`
${code}
\`\`\`'
JOKE_TEMPLATE:
description: 'The template for the FULL_REVIEW_JOKE prompt.'
default: 'Please analyze the pull request''s code and can you write a funny joke about it.:
\`\`\`
${code}
\`\`\`'
CODE_TEMPLATE:
description: 'The place for the actual code.'
default: '
\`\`\`
${code}
\`\`\`'
ANSWER_TEMPLATE:
description: 'The template for the answer sent to the GitHub comment.'
default: 'AI Code Review:
### Summary:
${answer}'
### Funny Joke about this PR:
${joke}'
runs:
using: 'node16'
main: 'dist/index.js'