@@ -17,8 +17,6 @@ concurrency:
1717
1818permissions :
1919 contents : read
20- issues : write
21- pull-requests : write
2220 actions : read
2321
2422jobs :
@@ -114,14 +112,47 @@ jobs:
114112 $CHANGED_FILES
115113 " > standards-analysis.txt
116114
117- - name : Post Standards Analysis Summary
115+ - name : Display Standards Analysis Summary
116+ if : steps.changed-files.outputs.any_changed == 'true'
117+ run : |
118+ echo "=================================="
119+ echo "π WORDPRESS STANDARDS REVIEW"
120+ echo "=================================="
121+ echo "Repository: ${{ github.repository }}"
122+ echo "Commit: ${{ github.sha }}"
123+ echo "Branch: ${{ github.ref }}"
124+ echo "Files Analyzed: ${{ steps.changed-files.outputs.all_changed_files_count }}"
125+ echo "Analysis Date: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"
126+ echo ""
127+ echo "π Files Reviewed:"
128+ echo "${{ steps.changed-files.outputs.all_changed_files }}"
129+ echo ""
130+ echo "π€ WordPress Expert Findings:"
131+ echo "=================================="
132+
133+ if [ -f "standards-analysis.txt" ]; then
134+ cat standards-analysis.txt
135+ else
136+ echo "β οΈ No analysis output found."
137+ fi
138+
139+ echo ""
140+ echo "=================================="
141+ echo "π Recommended Actions:"
142+ echo "- Review all findings marked as CRITICAL or HIGH priority"
143+ echo "- Implement suggested WordPress coding standards improvements"
144+ echo "- Test changes to ensure compatibility with WordPress 6.5+ and PHP 7.4+"
145+ echo "- Consider performance optimizations where recommended"
146+ echo "- Update documentation if architectural changes are suggested"
147+ echo "=================================="
148+
149+ - name : Create Workflow Summary
118150 if : steps.changed-files.outputs.any_changed == 'true'
119151 uses : actions/github-script@v7
120152 env :
121153 CHANGED_FILES : ${{ steps.changed-files.outputs.all_changed_files }}
122154 FILES_COUNT : ${{ steps.changed-files.outputs.all_changed_files_count }}
123155 with :
124- github-token : ${{ secrets.GITHUB_TOKEN }}
125156 script : |
126157 const fs = require('fs');
127158 const changedFiles = process.env.CHANGED_FILES;
@@ -137,8 +168,7 @@ jobs:
137168 analysisContent = 'Error reading standards analysis results.';
138169 }
139170
140- const title = `π WordPress Standards Review - ${context.sha.substring(0, 7)}`;
141- const body = `
171+ const summaryContent = `
142172 ## π― WordPress Best Practices Analysis Results
143173
144174 **Repository:** ${context.repo.owner}/${context.repo.repo}
@@ -170,60 +200,11 @@ jobs:
170200 **Workflow Run:** ${context.payload.repository.html_url}/actions/runs/${context.runId}
171201 `;
172202
173- // Create issue for standards review
174- try {
175- await github.rest.issues.create({
176- owner: context.repo.owner,
177- repo: context.repo.repo,
178- title: title,
179- body: body,
180- labels: ['code-standards', 'wordpress', 'ai-generated', 'needs-review']
181- });
182- console.log('β
Standards analysis issue created successfully');
183- } catch (error) {
184- console.log('β οΈ Could not create issue, writing to workflow summary instead');
185- await core.summary
186- .addHeading('π WordPress Standards Review')
187- .addRaw(body)
188- .write();
189- }
190-
191- - name : Comment on PR with Findings
192- if : github.event_name == 'pull_request'
193- uses : actions/github-script@v7
194- env :
195- FILES_COUNT : ${{ steps.changed-files.outputs.all_changed_files_count }}
196- with :
197- script : |
198- const fs = require('fs');
199- const filesCount = process.env.FILES_COUNT;
200-
201- // This would be the output from Gemini CLI
202- const comment = `
203- ## π― WordPress Best Practices Review
204-
205- Thank you for your contribution! I've analyzed your code changes for WordPress best practices and coding standards.
206-
207- ### π Analysis Summary
208- - **Files Analyzed:** ${filesCount}
209- - **WordPress Version:** 6.5+ compatible
210- - **PHP Version:** 7.4+ compatible
211-
212- ### π Key Areas Reviewed
213- β
WordPress Coding Standards
214- β
Plugin Architecture
215- β
Security Best Practices
216- β
Performance Considerations
217- β
Internationalization
203+ await core.summary
204+ .addHeading('π WordPress Standards Review')
205+ .addRaw(summaryContent)
206+ .write();
218207
219- > **Note:** This is an AI-powered analysis. Please review suggestions carefully and validate against the [WordPress Plugin Developer Handbook](https://developer.wordpress.org/plugins/).
220-
221- **Workflow Run:** ${context.payload.repository.html_url}/actions/runs/${context.runId}
222- `;
223-
224- await github.rest.issues.createComment({
225- issue_number: context.issue.number,
226- owner: context.repo.owner,
227- repo: context.repo.repo,
228- body: comment
229- });
208+ console.log('β
Standards analysis summary created in workflow logs');
209+
210+
0 commit comments