You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to run an auto-fixing Black linter, and it changes files but then fails to actually commit them.
name: Run Linters
on:
pull_request:
paths:
- 'c***p/**.py'
jobs:
run-python-linter:
name: Run Python Linter
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python dependencies
run: pip install black
- name: Run linters
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
black: true
black_args: -t py37 -l 120 --exclude "/*scripts*"
black_dir: c****d
auto_fix: true
commit_message: Fix code style issues with ${linter}
When I push to a branch that is in pull request, I get the following:
Will use Black to check the files with extensions py
Linting and auto-fixing files in /home/runner/work/Base/B***ad with Black…
reformatted /home/runner/work/Base/Base/c***views.py
All done! ✨ 🍰 ✨
1 file reformatted, 170 files left unchanged.
Black found no issues (success)
SHA of last commit is "704312c7d00bc047a4a552f56760a3f6f8e7dd2a"
Creating GitHub check with 0 annotations for Flake8…
Creating GitHub check with 0 annotations for Black…
I've starred out some file names and directories, sorry for the silly paranoia but it is a private corporate repository. Nonetheless, everything seems to be operating fine, it's finding a file that is indeed out of whack and is reformatting it - it just doesn't seem to recognize that there have been Git changes. I'm guessing this is because of the change to check for changes before committing? When I run Black and then "git diff-index --cached HEAD" on my own machine, it tells me there aren't changes even though there are. Is it possible that the "--cached" option is causing problems?
A potential confounding issue is that the pull request is the one that actually includes the linter workflow.
The text was updated successfully, but these errors were encountered:
I'm attempting to run an auto-fixing Black linter, and it changes files but then fails to actually commit them.
When I push to a branch that is in pull request, I get the following:
I've starred out some file names and directories, sorry for the silly paranoia but it is a private corporate repository. Nonetheless, everything seems to be operating fine, it's finding a file that is indeed out of whack and is reformatting it - it just doesn't seem to recognize that there have been Git changes. I'm guessing this is because of the change to check for changes before committing? When I run Black and then "git diff-index --cached HEAD" on my own machine, it tells me there aren't changes even though there are. Is it possible that the "--cached" option is causing problems?
A potential confounding issue is that the pull request is the one that actually includes the linter workflow.
The text was updated successfully, but these errors were encountered: