diff --git a/.github/workflows/lintcheck.yml b/.github/workflows/lintcheck.yml index 1778f4421ad1..6a5139b6dc0b 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 2fa527c5f871..bedcad790653 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