ci(size-diff): post comment when the artifact extracts flat (single app)#1555
Merged
Conversation
actions/download-artifact extracts a SINGLE matching artifact's files directly into the target dir, but lands MULTIPLE artifacts in per-artifact subdirs. The comment loop only iterated subdirectories, so single-app PRs (the common case — every release PR) had app/body.md sitting directly in DIR, failed the isDirectory() filter, and the job went green having posted nothing (observed on #1554 and #1440). Iterate DIR itself plus its immediate subdirs so both layouts work, and warn when nothing was posted so a silent miss can't recur.
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.
Problem
The size-diff comment (added in #1553) never posts on single-app PRs — confirmed on #1554 (jackett) and #1440 (esphome). The
Size Diff Commentworkflow_runjob ran, downloaded the artifact, and exited green having posted nothing.Root cause
actions/download-artifactextracts a single matching artifact's files directly into the targetpath, but lands multiple artifacts in per-artifact subdirs (path/<artifact-name>/). Thesize-diff-<app>artifact containsapp+body.mdat its root, so for a single-app PR they end up directly inDIR:The comment loop only iterated subdirectories (
if (!isDirectory()) continue), so both files were skipped, nothing was posted, and — since no code path errored — the job stayed green and logged nothing. Multi-app PRs happened to work (download-artifact uses subdirs there to avoidapp/body.mdname collisions).Verified the layout directly: the artifact's internal structure is
app+body.mdat the root, and the download step logsStarting download of artifact to: …/size-diff(no per-artifact subdir for the single match).Fix
Iterate
DIRitself plus its immediate subdirectories, so both extraction layouts work, andcore.warningif nothing was posted so a silent miss can't recur. Tested locally against both layouts:[]❌[jackett]✅[jackett, sonarr][jackett, sonarr]✅Validation note
This is the
workflow_runpath that can only run from the default branch, so it's first exercised after this merges. Once merged, re-running #1440'sPull Requestworkflow (or the next release PR) will confirm the comment posts end-to-end.