-
Notifications
You must be signed in to change notification settings - Fork 141
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
auto_fix: true fails when there are no changes to commit #140
Comments
Hi, thanks for the report. That's odd since changes were detected. Can you provide more details about your setup please? |
I see the same issue on a number of our repos using Swiftlint as the linter. |
@brennanwilkes FWIW, I had success seeing that my runner actually had a modified file outside the linter directory which caused this error for me. Enabling debug as described here: https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging showed me the file and I was able to |
The same thing happens with my setup: https://github.com/wh1t3h47/teste-desenvolvimento-web/runs/3198622148 |
Hello, I enabled debugging as described by @ghost (thank you a lot!) A possible workaround for this is enabling an empty commit, I know you can pass that option to git - I used to do it when I needed to test pre-commit hooks, as they lint the code and remove my change when I add some spaces to the code. In my case, what I did was just remove the yarn lockfile before linting (using the yml file), I don't know if this holds any consequence, but I don't think so, as the action shouldn't be messing with dependencies, only having them installed to run. My suggestion is that you add in the example a workflow that checks for lockfiles (npm, yarn) and unstages them before commiting, this would help people that may have issues with the lint-action |
@wh1t3h47, thank you so much for your suggestion, I have added that to my workflow and everything works like a charm. name: Lint
on: [push, pull_request]
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install Node.js dependencies
run: npm install
- name: Revert changes into the package-lock.json file
run: git checkout -- package-lock.json
- name: Run linters
uses: wearerequired/lint-action@v1
with:
auto_fix: true
eslint: true
eslint_dir: lib
eslint_extensions: js |
@AnthonyLzq Can we just do |
Wait, I don't think so, since you haven't commit yet. Git checkout or restore will return to the previous state of your package-lock.json file. |
The text was updated successfully, but these errors were encountered: