mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
infra stylebot: Delete existing comments
In order to avoid duplication of the already created comment, already created results will be deleted.
This commit is contained in:
parent
1b7f5d952e
commit
5e81beec53
1 changed files with 12 additions and 0 deletions
12
.github/workflows/cpp_lint_check.sh
vendored
12
.github/workflows/cpp_lint_check.sh
vendored
|
@ -49,6 +49,18 @@ if [[ $PAYLOAD_CPPLINT == *"Total errors found: "* ]]; then
|
|||
OUTPUT+=$'\n```\n'
|
||||
fi
|
||||
|
||||
curl $COMMENTS_URL > comments.json
|
||||
EXIST_COMMENTS=`jq -r '.[] | select(.body | contains("*CODING STYLE CHECK*")) | .id' comments.json`
|
||||
echo $EXIST_COMMENTS
|
||||
for exist_comment in $EXIST_COMMENTS
|
||||
do
|
||||
echo "---------------------"
|
||||
echo $exist_comment
|
||||
COMMENT_URL="https://api.github.com/repos/Samsung/thorvg/issues/comments/""$exist_comment"
|
||||
curl -X "DELETE" -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" "$COMMENT_URL"
|
||||
echo "=================="
|
||||
done
|
||||
|
||||
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
|
||||
|
||||
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
|
||||
|
|
Loading…
Add table
Reference in a new issue