Closed ikerexxe closed 2 years ago
What do you want to achieve? If you do not want to send the check result to commit, Should have skipped here https://github.com/linuxdeepin/action-cppcheck/blob/fab2b612ccb9f4c811086a5609e719a6bfb0558f/cmd/action-cppcheck/main.go#L126-L134
Maybe code -1 should be used to make the action fail?
I'd like to remove only the check result, as an example: https://github.com/SSSD/sssd/pull/6089#pullrequestreview-927578085. I'd like to keep the errors themselves being published on the PR. I think that your proposal would also remove those. Am I right?
Do you want to delete outdated comments or not send any comments? The Go Program is written for posting comments. if you do not need comment, can use the workflow
steps:
- uses: actions/checkout@v3
- name: install
run: sudo apt install -y cppcheck
- name: run
run: cppcheck --enable=all --error-exitcode=-1 ./ 1>/dev/null
Do you want to delete outdated comments or not send any comments? The Go Program is written for posting comments. if you do not need comment, can use the workflow
steps: - uses: actions/checkout@v3 - name: install run: sudo apt install -y cppcheck - name: run run: cppcheck --enable=all --error-exitcode=-1 ./ 1>/dev/null
It's not clear for me that you are understanding what I'm trying to fix so I'd like to clarify it further.
This action posts two types of comments: the errors detected by cppcheck and the final result (Good or improvements are needed). I'd like the action to continue posting the errors detected by cppcheck, but I'd like to make the posting of the final result configurable. This way, I can configure it to disable the posting of the result for some workflows.
https://github.com/myml/action-cppcheck/commit/25df296b56ec1345cbc19d66b733040a50bbe286 I modified the action.yam file to achieve it, it is what you want?
Test results here
myml@25df296 I modified the action.yam file to achieve it, it is what you want?
No, but it's good that your provided the test results because it will enable me to explain myself correctly.
I don't want the tool to post the final result comment. But I want the tool to post the errors detected.
I get it. This code is ok.
Thank you for taking care of it!
Hi @ikerexxe ! I forgot one thing. If comment_result is set to false and code checks out ok, then there is no need to call CreateReview agent. Unable to create a review without 'body' and 'comments'
Unable to create a review without 'body' and 'comments'
Is this an error message from the action?
Error from github api
2022/04/08 07:22:01 POST https://api.github.com/repos/myml/test/pulls/3/reviews: 422 Unprocessable Entity [{Resource: Field: Code: Message:You need to leave a comment indicating the requested changes.}]
I'm not an expert in GO so please review with care as I may have inadvertently made a very big mistake.