Releases: swiftlysingh/swiftui-accessibility-bot
Improved SwiftUI View Detection
What’s Changed
-
SwiftUI View Filtering:
The bot now only processes Swift files that both import SwiftUI and declare a struct conforming to theViewprotocol (e.g.,struct MyView: View).
This prevents non-view files (such as models or utilities) from being unnecessarily processed, making the action more efficient and accurate. -
Internal Improvements:
- Updated the file detection logic in the entrypoint script to use a two-step
grepfor bothimport SwiftUIandstruct ...: View. - No changes to the accessibility logic or output format.
- Updated the file detection logic in the entrypoint script to use a two-step
Upgrade Notes
- No action required for users.
- The action will now skip Swift files that do not contain SwiftUI views, reducing noise and irrelevant PRs.
v1.0.0 - Initial Release of SwiftUI Accessibility Bot
This is the initial release of the SwiftUI Accessibility Bot! 🎉
This GitHub Action helps you automatically improve the accessibility of your SwiftUI views. It uses OpenAI's language models to analyze your code, suggest accessibility enhancements, and then applies them directly, creating a pull request for your review.
Key Features:
- Automated Accessibility Improvements: Leverages the power of LLMs (e.g., GPT-4.1) to identify and implement common accessibility modifiers for SwiftUI.
- Pull Request Creation: Automatically creates a new branch and a pull request with the suggested changes, making it easy to review and merge.
- Customizable OpenAI Model: While it defaults to gpt-4.1, you can specify other OpenAI models like gpt-4-turbo to suit your needs.
- Flexible File Processing:
- Process all SwiftUI files in your repository.
- Optionally, process only the SwiftUI files that were changed in the commit that triggered the workflow.
- Easy Integration: Simple to add to your existing GitHub Actions workflows.
How to Use:
Refer to the README.md for detailed instructions on how to set up and configure the action in your repository.
Example Workflow Snippet:
uses: your-username/swiftui-accessibility-bot@v1.0.0 # Or your action's path
env:
GH_TOKEN: ${{ github.token }}
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
# openai_model_name: 'gpt-4-turbo' # Optional
# process_changed_files_only: true # Optional
I hope this action helps you build more accessible SwiftUI applications! Please report any issues or suggest features on the repository's issue tracker.
Full Changelog: https://github.com/swiftlysingh/swiftui-accessibility-bot/commits/v1.0.0