fix: rename workflow and update AI description generation method

This commit is contained in:
faris Aljohari
2025-07-15 23:19:22 -06:00
parent 65d4a56135
commit a4095c837b

View File

@ -1,4 +1,4 @@
name: 🤖 AI PR Description Generator (with Template)
name: 🤖 AI PR Description Commenter (Safe Mode)
on:
pull_request:
@ -37,7 +37,7 @@ jobs:
"model": "gpt-4o",
"messages": [{
"role": "user",
"content": "Given the following commit messages:\n\n'"${commits}"'\n\nFill only the \"## Description\" section in this pull request template:\n\n<!--\n Thanks for contributing!\n\n Provide a description of your changes below and a general summary in the title.\n-->\n\n## Jira Ticket\n\n[SP-0000](https://syncrow.atlassian.net/browse/SP-0000)\n\n## Description\n\n<!--- Describe your changes in detail -->\n\n## How to Test\n\n<!--- Describe the created APIs / Logic -->"
"content": "Given the following commit messages:\n\n'"${commits}"'\n\nGenerate a clear and professional pull request description."
}]
}')
@ -49,8 +49,8 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
commits: ${{ env.commits }}
- name: Update PR Body with AI Description
- name: Post AI Generated Description as Comment
run: |
gh pr edit ${{ github.event.pull_request.number }} --body "${{ env.description }}"
gh pr comment ${{ github.event.pull_request.number }} --body "${{ env.description }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}