Skip to content

Commit

Permalink
GH workflow: don't post linter reports if they are > 54KB (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
isudak authored Apr 15, 2024
1 parent eabbb7e commit 6495806
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/preflight-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,21 @@ jobs:
cat test-summary.md
printf "\n\n### Code Coverage Summary\n"
cat code-coverage-results.md
JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/${{ github.event.workflow_run.id }}"
printf "\nView full reports on the [Job Summary]($JOB_URL \"Go to Job Summary\") page\n\n"
printf "\n"
cat {pylint,black,isort,bandit}-report.md > linter-reports.md 2>/dev/null || true
if [[ -s linter-reports.md ]]; then
printf "### Linter reports\n"
cat linter-reports.md
# Max size of comments on GitHub is 64KB. If the reports > 54KB, don't post them
if [[ $(stat --format=%s linter-reports.md) -gt 55296 ]]; then
printf "The reports are too big to be posted here.\n"
else
cat linter-reports.md
fi
fi
JOB_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/${{ github.event.workflow_run.id }}"
printf "View full reports on the [Job Summary]($JOB_URL \"Go to Job Summary\") page.\n"
} > preflight-report.md
- name: Comment PR
Expand Down

0 comments on commit 6495806

Please sign in to comment.