Reduce false-positive “New Music Update” issues in music-social workflow#271
Merged
Conversation
|
|
6 tasks
Copilot
AI
changed the title
[WIP] Fix Lighthouse scores below acceptable threshold
Reduce false-positive “New Music Update” issues in music-social workflow
Jun 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the music-social GitHub Actions workflow to reduce false “New Music Update” issue creation by narrowing the detection logic to changes within the YOUTUBE-AUTO section of music.html, rather than scanning all added lines across the file.
Changes:
- Compute and reuse
BASE_REF/TARGET_REFonce, then deriveDIFF, line stats, and detection from those refs. - Extract and compare only the
<!-- YOUTUBE-AUTO-START -->…<!-- YOUTUBE-AUTO-END -->block to decide whether to sethas_music_content=true. - Update the music-content detection to rely on added content from that extracted block using a supported-link regex.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+65
| MUSIC_LINK_PATTERN='https?://(www\.)?(youtube\.com|youtu\.be|soundcloud\.com|bandcamp\.com)' | ||
| NEW_MUSIC_BLOCK=$(git show "$TARGET_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p') | ||
| if [ "$BASE_REF" = "$EMPTY_TREE" ]; then | ||
| OLD_MUSIC_BLOCK="" | ||
| else | ||
| OLD_MUSIC_BLOCK=$(git show "$BASE_REF:music.html" | sed -n '/<!-- YOUTUBE-AUTO-START -->/,/<!-- YOUTUBE-AUTO-END -->/p') | ||
| fi | ||
| MUSIC_BLOCK_DIFF=$(diff -u <(echo "$OLD_MUSIC_BLOCK") <(echo "$NEW_MUSIC_BLOCK") || true) | ||
| MUSIC_BLOCK_ADDED=$(echo "$MUSIC_BLOCK_DIFF" | grep "^+" | grep -v "^+++" | sed 's/^+//' | head -50) | ||
|
|
DavidKRK
approved these changes
Jun 3, 2026
DavidKRK
left a comment
Owner
There was a problem hiding this comment.
Beau clean-up de la détection.
Le passage à BASE_REF / TARGET_REF rend le diff plus lisible, et le fait de cibler le bloc YOUTUBE-AUTO évite les faux positifs liés aux simples lignes ajoutées.
LGTM, j’approuve.
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
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.
The music-social automation was opening “New Music Update” issues for non-musical edits to
music.html(e.g., Lighthouse-related changes).This PR narrows detection to real music-content additions so social-post issues are created only when new platform links are actually added.
Scope detection to real music content
BASE_REF/TARGET_REF) and keep existing global line stats.YOUTUBE-AUTOblock instead of scanning all added lines.has_music_content=trueonly when added lines in that block contain supported music links (youtube,youtu.be,soundcloud,bandcamp).Harden edge-case handling
git showbehavior when no prior tree containsmusic.html.