-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ultralytics Actions with OpenAI GPT-4 PR Summary #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Type: Enhancement
PR Summary: The pull request introduces enhancements to the Ultralytics Actions workflow by adding new formatting and validation features, including a PR summary generated by OpenAI GPT-4. The changes aim to improve code and documentation quality according to the official Ultralytics standards.
Decision: Comment
📝 Type: 'Enhancement' - not supported yet.
- Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.
General suggestions:
- Review the security implications of changing the event trigger from
pull_request_target
topull_request
to ensure that no unintended permissions or data exposures occur. - Consider the cost implications and potential for abuse with the integration of OpenAI GPT-4 for PR summaries, and implement necessary safeguards.
- Clarify the functionality of the 'markdown' option if it also formats YAML, to ensure that the naming and comments are not misleading.
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
.github/workflows/format.yml
Outdated
@@ -7,7 +7,7 @@ name: Ultralytics Actions | |||
on: | |||
push: | |||
branches: [main,master] | |||
pull_request_target: | |||
pull_request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (llm): Changing from pull_request_target
to pull_request
alters the permissions and event context. Ensure that this change doesn't introduce any security vulnerabilities, especially if the workflow uses the GITHUB_TOKEN
or other secrets in the context of a pull request from a fork.
markdown: true # format Markdown and YAML | ||
spelling: true # check spelling | ||
links: true # check broken links | ||
summary: true # print PR summary with GPT4 (requires 'openai_api_key' or 'openai_azure_api_key' and 'openai_azure_endpoint') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (llm): The addition of GPT-4 summary generation is an interesting feature. However, it's important to consider the potential costs associated with the OpenAI API usage and ensure that there are checks in place to prevent abuse or excessive use.
links: true | ||
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify | ||
python: true # format Python code and docstrings | ||
markdown: true # format Markdown and YAML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): The comment '# format Markdown and YAML' might be misleading as the option name 'markdown' suggests it's only for Markdown. If it indeed formats YAML, consider renaming the option to reflect both formats or updating the comment to avoid confusion.
This pull request adds an improved Ultralytics Actions workflow to automatically format code and documentation to the new Ultralytics official standards maintained at https://github.com/ultralytics/actions.
Six individual actions are run by default now including a new PR Summary utilizing OpenAI GPT-4. Disable individual actions by setting them to false or removing their line, i.e. delete 'markdown: true' line to disable markdown formatting.
Note that additional spellings have been added to the Ultralytics spelling dictionary and frontmatter is now ignored by markdown formatters per your feedback.
To customize an action use a
pyproject.toml
file in this repo. For details see https://github.com/ultralytics/actions.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhancements to the GitHub Actions workflow for automated code formatting and PR summarization.
📊 Key Changes
pull_request_target
topull_request
for workflow activation.openai_api_key
oropenai_azure_api_key
andopenai_azure_endpoint
for the new summary feature.🎯 Purpose & Impact