-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
lint-staged
fails to run on Github Actions workflow: ✖ Failed to get staged files!
#1198
Comments
Hey @hbarcelos. - uses: actions/checkout@v2
with:
fetch-depth: 0 |
I would suggest trying to fetch all remotes or something before running. The error message isn't very helpful in this case. |
how can I run this workflow using npm? |
Trying with this but I am getting ✖ Failed to get staged files!
|
@limaho @hbarcelos specifying
|
Works great. Thanks @lorenburton 😊 |
Is this something we could add to the README? |
For me only this works: steps:
- uses: actions/checkout@v3
with: { fetch-depth: 0 }
...
- name: ESLint & Prettier
run: npx lint-staged --diff=origin/main |
Description
I'm abusing
lint-staged
a little bit to enforce linting rules are being followed on pull requests.Linters and their configs are the only things in our stack that are installed using
yarn
, so it happens sometimes that people forget to runyarn install
and the rules are not enforced in thepre-commit
hook.Steps to reproduce
I created a
.github/workflows/lint.yml
file:Debug Logs
Expand to view
Environment
lint-staged
: 13.0.3The text was updated successfully, but these errors were encountered: