Skip to content
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

run shellcheck only on files that are changed #20

Open
traktofon opened this issue Mar 12, 2025 · 4 comments
Open

run shellcheck only on files that are changed #20

traktofon opened this issue Mar 12, 2025 · 4 comments

Comments

@traktofon
Copy link
Collaborator

please

@traktofon
Copy link
Collaborator Author

@ikirker Is this possible?

@ikirker
Copy link
Contributor

ikirker commented Mar 18, 2025

Once the initial wave of fixes are in, it should be less noisy, BUT

This might be possible?

The problem is effectively trying to get the commit hash you should compare to, in:

git diff --name-only $previous_commit_hash HEAD

which gives the list of changed files.

@traktofon
Copy link
Collaborator Author

Ah, I wasn't aware that getting the list of changed files is something that one has to arrange oneself. (But then I started to suspect so when I heard about the compromise of a seemingly popular changed-files GH action...) Naively thought that's something that's readily available in some way to the action.

That said, doesn't git show include the list of files that were changed in this commit, without having to know about the "previous" commit? Unfortunately it also shows the commit message, but perhaps something like

git show [<commit>] --name-only --pretty=oneline | tail -n +2

would be a starting point?

@ikirker
Copy link
Contributor

ikirker commented Mar 20, 2025

The problem then comes when you push more than one commit at once: only the files altered in the most recent one would get checked, because it only runs tests against the last commit. In that kind of situation, it's likely to miss a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants