-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add automatic AI cover generation for new blog articles #32
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
Merged
Conversation
This file contains hidden or 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
- 🚀 NEW: Automatic AI cover generation on push to main branch - 🧠 Smart detection: Only generates covers for articles with description but no AI cover - 🛡️ API protection: Limits processing to 5 files per push to avoid overload - 📝 Enhanced workflow: Added push trigger with intelligent file filtering - 🔧 Script improvements: Fixed front matter parsing, added --specific-file support - 📚 Updated documentation: Comprehensive guides and integration reports - 🎨 Generated covers: Added 17 high-quality AI-generated covers This enables zero-touch AI cover generation - simply commit new articles and AI covers are automatically generated using ModelScope Qwen-image API. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Change git push from main to HEAD to work with feature branches - Fixes 'src refspec main does not match any' error - Ensures image optimization works on all branches 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Change from 'HEAD' to '${{ github.ref_name }}' for proper Git reference
- Fixes 'not a full refname' error
- Ensures push works correctly with feature branches
- Uses GitHub Actions built-in ref_name variable
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Implement smart branching logic for different scenarios:
* main branch: git push origin main
* pull request: git push origin HEAD:${{ github.ref }}
* feature branches: git push origin HEAD:${{ github.ref_name }}
- Fixes refname issues with GitHub Actions context
- Handles both push and pull_request events properly
- Ensures compatibility across different branch types
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix PR branch detection using GitHub API - Use jq to extract source branch from PR data - Install jq dependency for JSON parsing - Push to source branch instead of PR merge ref - Handle case where source branch cannot be determined Resolves 'deny updating a hidden ref' error for pull_request events. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
生成多尺寸图片 (320px, 640px, 960px, 1280px, 1920px) 转换为WebP格式以减少文件大小 应用智能压缩 (质量: 85%) 此提交由GitHub Actions自动生成
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Summary
This PR introduces automatic AI cover generation for new blog articles, making the blog content creation workflow completely hands-free. When new articles are committed to the main branch, AI covers are automatically generated using the ModelScope Qwen-image API.
✨ Key Features
🆕 Automatic Generation (Push Trigger)
descriptionbut missingai_coverdaily_ai/directory to prevent redundant processing🧠 Enhanced Workflow
.github/workflows/generate-blog-images.ymlwith intelligent file filtering🔧 Technical Improvements
scripts/ai_cover_generator.pywith--specific-filesupport📊 Files Changed
.github/workflows/generate-blog-images.yml- Enhanced with push triggerscripts/ai_cover_generator.py- New automatic generation capabilities🎯 Usage Examples
Automatic (Recommended)
Manual Generation
🧪 Testing
📈 Impact
🔒 Security & Performance
📚 Documentation
docs/modelscope-github-workflow-integration.mddocs/modelscope-ai-cover-integration.mddocs/change-proposals/2025-11-12-add-modelscope-ai-cover-generation.mdCLAUDE.mdwith new commands🎉 Result
The blog now has fully automated AI cover generation. Content creators can focus on writing while the system handles visual content automatically. This represents a significant improvement in content creation efficiency and quality.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com