ci(flash-analysis): skip PR comment when flash delta is zero (#27660)

#27473 removed the +/-50 byte threshold so small deltas were no longer
suppressed, but that also made zero-impact PRs get a comment. Restore
suppression only for exactly 0-byte deltas on all targets. An existing
comment is still always updated so it never goes stale.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
This commit is contained in:
Jacob Dahl authored and GitHub committed 2026-06-12 13:31:36 -06:00
1 parent f029c5df26
commit 06dd47550f
1 file changed
+18
+18
View File
@@ -155,12 +155,26 @@ jobs:
V6X-SUMMARY-MAP-PERC: ${{ fromJSON(fromJSON(needs.analyze_flash.outputs.px4_fmu-v6x-bloaty-summary-map).vm-percentage) }}
if: github.event.pull_request
steps:
- name: Find Comment
uses: peter-evans/find-comment@v4
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- pr-comment-poster:flash-analysis -->'
- name: Set Build Time
id: bt
run: |
echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Write pr-comment artifact
# Skip only when the diff is exactly 0 bytes on all targets and no comment exists yet.
# This can't be moved to the job-level conditions, as GH actions don't allow a job-level if condition to access the env.
if: |
steps.fc.outputs.comment-id != '' ||
env.V5X-SUMMARY-MAP-ABS != 0 ||
env.V6X-SUMMARY-MAP-ABS != 0
run: |
mkdir -p pr-comment
cat > pr-comment/manifest.json <<EOF
@@ -193,6 +207,10 @@ jobs:
PR_COMMENT_BODY_EOF
- name: Upload pr-comment artifact
if: |
steps.fc.outputs.comment-id != '' ||
env.V5X-SUMMARY-MAP-ABS != 0 ||
env.V6X-SUMMARY-MAP-ABS != 0
uses: actions/upload-artifact@v7
with:
name: pr-comment