-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CI] add shellcheck-workflow #32052
[CI] add shellcheck-workflow #32052
Conversation
I think we need it because of opentelemetry-collector-contrib/.github/workflows/scripts/check-collector-module-version.sh Line 11 in 394d9b4
Running
Feels like a lint to me, I am also fine with a separate workflow at first to not make it required from the beginning.
What's the motivation for that? I guess if something is inside |
Well if you want to, we could change that and let it check every *.sh-type. Fixed it in latest commit. Btw we should consider what our severity-level should be, because with nothing set we will get failed shellcheck-runs because of info / warning-messages.. Edit: |
@TylerHelmuth what do you think? |
In general, I'm not a fan of using GitHub Actions "actions" for everything, even for relatively simple things like this. Reasons:
In this case, running shellcheck should be easy enough with |
8ce3df7
to
6951c4f
Compare
Thanks @led0nk! |
Description:
So i fixed the issues which shellcheck displayed, which were only 3 double quote issues and the
read -r
issue.After looking into the closed PR i also replaced
printf
-statements withecho
.For the shellcheck-worfklow I used https://github.com/ludeeus/action-shellcheck
I didn't find a way to check multiple directories at once, so we just use 2 steps here.
I added the disabled checks provided by the intentional issue, but i'm not quite sure if we need to add
-x
here. Couldn't find anything in the documentation so far.On top of that i'm not quite sure if we should run the shellcheck in dependency of any other workflows or just on its own.
Edit:
I added the option
ignore_paths
so that shellcheck-action is only run in specified paths and ignores subpaths of this directory.Link to tracking Issue:
Testing:
Documentation: