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

[ISSUE] Github Action Black failing after successful reformatting. #4156

Open
tikendraw opened this issue Jan 18, 2024 · 1 comment
Open
Labels
T: bug Something isn't working

Comments

@tikendraw
Copy link

Describe the bug

Trying to use Black in github actions and it is failing after reformatting.
Shouldn't it be passing after reformatting without errors ?

name: Lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: psf/black@stable

To Reproduce
use black in github action

The resulting error is:
failing github action after reformatting

would reformat /home/runner/work/catsay/catsay/catsay/cat.py

Oh no! 💥 💔 💥
1 file would be reformatted, 4 files would be left unchanged.
Error: Process completed with exit code 1.

Expected behavior
If black has reformatted files witout any errors then actions should pass a success, not a fail

@tikendraw tikendraw added the T: bug Something isn't working label Jan 18, 2024
@dankrzeminski32
Copy link
Contributor

Hi @tikendraw,

The black GitHub action doesn't format your files by default. See the following lines in the documentation,

You can also configure the arguments passed to Black via options (defaults to '--check --diff') and src (default is '.').

The action's default behavior is simply to notify you of changes it would've made if called without the --check flag

If you're looking for the action to make the changes for you then you may find this documentation helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants