Bump @babel/traverse from 7.11.5 to 7.23.2 #152
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
name: Analyze PR files and add descriptions | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
analyze-pr-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR files | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Send files to ChatGPT | |
uses: openai/action-chatbot@v1 | |
with: | |
api-key: ${{ secrets.OPENAI_API_KEY }} | |
model: text-davinci-002 | |
prompt: "Please analyze the following files and provide brief descriptions:" | |
context: | | |
${{ toJson(github.event.pull_request.head.repo.files) }} | |
- name: Add descriptions to PR | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
const prDescription = 'PR file descriptions:\n' + process.env.CHATGPT_RESPONSE | |
const prNumber = context.payload.pull_request.number | |
const octokit = new GitHub() | |
await octokit.pulls.update({ | |
...context.repo, | |
pull_request_number: prNumber, | |
body: prDescription | |
}) | |
env: | |
CHATGPT_RESPONSE: ${{ steps.chatbot.outputs.response }} |