luizm / action-sh-checker

A GitHub action that performs static analysis for shell scripts using shellcheck, shfmt and checkbashisms.
MIT License
132 stars 12 forks source link

bot won't comment on failing PR #49

Closed alan-barzilay closed 3 years ago

alan-barzilay commented 3 years ago

Hello, first of all thank you for the action, it has been really useful!

I've recently added this action to a repository and it is working fine, except for the fact that when a test fails no comments are posted to the PR even though sh_checker_comment is set to true. Is there something else that needs to be done? Thank you for your time!

action configuration: https://github.com/kworkflow/kworkflow/blob/unstable/.github/workflows/shfmt.yml action failing in a pr but no comment from the bot: https://github.com/kworkflow/kworkflow/pull/324

luizm commented 3 years ago

Hey.. thank you for the report.

I've just checked your cfg, and it seems rigth.. I'm not able to check it now, but I will do it soon.

luizm commented 3 years ago

@alan-barzilay I did some tests using the exactly you cfg and it works.. maybe try to rerun?

alan-barzilay commented 3 years ago

@luizm it just worked on another branch of mine, I have no idea why this is happening in this branch haha I will try to rerun it and let you know if it works

alan-barzilay commented 3 years ago

@luizm no luck, nothing happened again. I noticed that for some reason only a pr check is being triggered, while in my personal fork where the bot worked, the push check was also being triggered. Could this be related? is the bot triggered by the push check or the pr check should be the one triggering it? Or maybe it has something to do with who owns the repository, when you tested it was it in your own repo? Because in my personal fork it seems to work as well

The only other thing I could think of is that I'm using the v2 of the github checkout action instead of the v1 described in the readme, but it doesn't seem to related

luizm commented 3 years ago

Or maybe it has something to do with who owns the repository, when you tested it was it in your own repo? Because in my personal fork it seems to work as well

Yes. I'm using in a private repository,

I just wondering if this issue could be related to GITHUB_TOKEN, Could you use a PAT just to validate if the issue is in the GITHUB_TOKEN that is created automatically for each workflow?

alan-barzilay commented 3 years ago

@luizm sorry for a probably stupid question, but how do I do this? By what exactly should I substitute the github token line? and it is an open repository, should I take any sort of security precautions before I share my personal access token in the repo? I have never needed to use them before so I'm a bit lost, my apologies

luizm commented 3 years ago

@alan-barzilay I've just done a little modification https://github.com/luizm/action-sh-checker/commit/ab2960c5047ce06d8446efe8ef514b1efd5fc14c. Now the github call will be showing the results, so you can see if there is an error during the process to comment.

Could you try using the latest version, like uses: luizm/action-sh-checker@master

alan-barzilay commented 3 years ago

hi @luizm thank you for your help and sorry for the radio silence. I realized that this issue also happens with another github action that we recently added so I believe this has nothing to do your action and I will close this issue. Sorry for the trouble, we are investigating our settings, I believe we haven´t given permission to something.