ci: hide old benchmark reports for PRs with many comments

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3780
GitOrigin-RevId: 47414b17e311184fc038ef8291091c1d67a991aa
This commit is contained in:
awjchen 2022-02-24 13:08:22 -07:00 committed by hasura-bot
parent 1181625173
commit dcaa6a7bc3

View File

@ -13,12 +13,14 @@ set -euo pipefail
# the comment starts with "## Benchmark Results".
# Get all issue comments.
# https://docs.github.com/en/rest/reference/issues#list-issue-comments-for-a-repository
# Get issue comments.
# Note: We currently only fetch the first 100 comments. This may not be
# sufficient in the future.
# https://docs.github.com/en/rest/reference/issues#list-issue-comments
curl \
-s \
-H "Authorization: token ${GITHUB_TOKEN}" \
-X GET "https://api.github.com/repos/hasura/graphql-engine-mono/issues/${PR_NUMBER}/comments" | \
-X GET "https://api.github.com/repos/hasura/graphql-engine-mono/issues/${PR_NUMBER}/comments?per_page=100" | \
# Keep only the benchmark reports.
jq -r -c '.[] | {id: .id, body: .body} | select(.body | startswith("## Benchmark Results"))' | \
# Update the benchmark reports to hide them.