Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH workflow: don't post linter reports if they are > 54KB #91

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading