CircleCI-Public / shellcheck-orb

An orb for ShellCheck, a static analysis tool for shell scripts (https://shellcheck.net) — check all scripts in your repository on every commit
https://circleci.com/developer/orbs/orb/circleci/shellcheck
MIT License
19 stars 26 forks source link

orb fails when a git branch name ends in ".sh" #42

Closed landism closed 2 years ago

landism commented 3 years ago

Orb version:

2.24

What happened:

I pushed a git branch named "matt/run_all_test.sh"

Since git stores branches as directories inside of .git, the shellcheck orb's find command found this directory and tried to shellcheck its contents:

In ./.git/refs/heads/matt/run_all_test.sh line 1:
a6b1eaea75129ffa07ffd28ac30edd43f2f1c700
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.

Expected behavior:

contents of .git are ignored by default, or failing that, once I've figured out what's going on, there's some workaround allowing me to continue to use this orb (AFAICT right now my only option is to delete the branch)

Additional Information:

some potential solutions that come to mind: