Fix: Réparer le workflow d'agrégation automatique des articles#18
Conversation
Problèmes résolus : - ✅ Correction fonction sanitizeArticle : suppression appels addUTMParams() et cleanSummary() inexistants - ✅ Utilisation de getArticleLink() pour liens directs sans UTM tracking - ✅ Suppression code dupliqué htmlEscape() - ✅ Correction package.json : déplacement sanitize-html vers dependencies - ✅ Mise en commentaire LinkedIn dans le workflow (temporairement désactivé) Le workflow devrait maintenant s'exécuter toutes les 6h sans erreur.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe PR modernizes article processing by integrating HTML sanitization library, refactoring aggregator logic to use unified sanitization instead of manual escaping, reorganizing package dependencies, and disabling LinkedIn credential integration in the CI/CD workflow. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✏️ Tip: You can disable this entire section by setting Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes the automated article aggregation workflow by removing calls to non-existent functions, cleaning up duplicate code, correcting the package.json structure, and temporarily disabling LinkedIn integration.
Changes:
- Removed duplicate
htmlEscape()function and calls to non-existentaddUTMParams()andcleanSummary()functions insanitizeArticle() - Fixed package.json structure by moving
sanitize-htmlfrom a malformed location to the properdependenciessection - Commented out LinkedIn environment variables in the GitHub workflow (temporarily disabled)
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/aggregator.js | Removed duplicate htmlEscape() function definition and fixed sanitizeArticle() to use existing sanitizeText() and getArticleLink() functions instead of non-existent ones |
| package.json | Fixed JSON structure by moving sanitize-html dependency to proper location within dependencies object |
| package-lock.json | Updated lock file metadata (name, version, license) and structure to match package.json changes |
| .github/workflows/update-ai-pulse.yml | Commented out LinkedIn-related environment variables to temporarily disable LinkedIn integration |
Comments suppressed due to low confidence (4)
src/aggregator.js:4
- Unused variable Octokit.
const { Octokit } = require('@octokit/rest');
src/aggregator.js:38
- Unused function htmlEscape.
function htmlEscape(input) {
src/aggregator.js:237
- Unused function postToLinkedIn.
async function postToLinkedIn(article) {
src/aggregator.js:251
- Unused variable response.
const response = await axios.post(
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -29,9 +29,10 @@ jobs: | |||
| npm install axios cheerio rss-parser @octokit/rest | |||
There was a problem hiding this comment.
The workflow is missing the sanitize-html dependency in the install step. The code at line 5 of src/aggregator.js requires sanitize-html, but the npm install command only includes axios, cheerio, rss-parser, and @octokit/rest. This will cause the workflow to fail with a module not found error. Consider either adding sanitize-html to the install command or replacing line 29 with npm install to install all dependencies from package.json.
…mprovements (XSS mitigation, PII removal)
Problèmes résolus :
Le workflow devrait maintenant s'exécuter toutes les 6h sans erreur.
Summary by CodeRabbit
Changes
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.