about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/lintcheck.yml2
-rw-r--r--lintcheck/src/json.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/.github/workflows/lintcheck.yml b/.github/workflows/lintcheck.yml
index 1778f4421ad..6a5139b6dc0 100644
--- a/.github/workflows/lintcheck.yml
+++ b/.github/workflows/lintcheck.yml
@@ -119,10 +119,10 @@ jobs:
       # https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
       # That's why we first log to file and then to the summary and logs
       run: |
-        ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
         ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
         head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
         cat truncated_diff.md
+        ./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
 
     - name: Upload full diff
       uses: actions/upload-artifact@v4
diff --git a/lintcheck/src/json.rs b/lintcheck/src/json.rs
index 2fa527c5f87..bedcad79065 100644
--- a/lintcheck/src/json.rs
+++ b/lintcheck/src/json.rs
@@ -82,6 +82,10 @@ pub(crate) fn diff(old_path: &Path, new_path: &Path, truncate: bool) {
     print_summary_table(&lint_warnings);
     println!();
 
+    if lint_warnings.is_empty() {
+        return;
+    }
+
     let truncate_after = if truncate {
         // Max 15 ensures that we at least have five messages per lint
         DEFAULT_LIMIT_PER_LINT