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

[BUG] Checking all files when using only_changed and dry #61

Open
olaven opened this issue Jul 28, 2021 · 8 comments · Fixed by #48
Open

[BUG] Checking all files when using only_changed and dry #61

olaven opened this issue Jul 28, 2021 · 8 comments · Fixed by #48
Labels
bug Something isn't working hacktoberfest

Comments

@olaven
Copy link

olaven commented Jul 28, 2021

Hi! Thank you for maintaining this action :-)
I'm unfortunaltely experiencing what I believe is unexpected behaviour when using the config below.

What exactly happened?
Fails even though all files in changed in the latest commit are formatted properly.

Steps to reproduce the behavior:

  1. add code to a file, and format it according to the .prettierrc
  2. use the following github job:
jobs:
  prettier:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
          fetch-depth: 0
      - name: Prettify code
        uses: creyD/prettier_action@v3.3
        with:
          dry: True
          only_changed: True
          prettier_options: --write **/*.{ts,js} --config ./.prettierrc
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

What should've happened?
I expected the job to pass. Other files in the repository are
not properly formatted, but I expected those to be ignored due to only_changed: True.

I'm using v3.3.

@olaven olaven added the bug Something isn't working label Jul 28, 2021
@olaven olaven changed the title [BUG] Checking all files when using only_changed and dry` [BUG] Checking all files when using only_changed and dry Jul 28, 2021
@creyD creyD linked a pull request Sep 7, 2021 that will close this issue
@creyD creyD closed this as completed in #48 Sep 7, 2021
@ghost
Copy link

ghost commented Nov 30, 2021

I'm experiencing the same issue with v4.0. @olaven what about you?

@andycookfr
Copy link

andycookfr commented Dec 6, 2021

I'm still getting this too.

    INPUT_COMMIT_MESSAGE: Prettified Code!
    INPUT_COMMIT_DESCRIPTION: 
    INPUT_SAME_COMMIT: false
    INPUT_COMMIT_OPTIONS: 
    INPUT_FILE_PATTERN: *
    INPUT_PRETTIER_OPTIONS: --check **/*.{js,jsx,less}
    INPUT_DRY: true
    INPUT_PRETTIER_VERSION: false
    INPUT_ONLY_CHANGED: true
    INPUT_PRETTIER_PLUGINS: 
    INPUT_WORKING_DIRECTORY: false
    INPUT_GITHUB_TOKEN: ***

The output suggests that there are no matching files (as I'd expect; my PR has no js/jsx/less changes):

Installing prettier...
Prettifying files...
Files:
Checking formatting...
...

But then goes on to run all files in the repo anyway and fails.

EDIT: This is running the latest version of the action, 4.1.1

@creyD creyD reopened this Dec 6, 2021
@adamaraujoglobant
Copy link

I have the same problem. Even using the configuration to run only in the files changed, the action is trying to run in all files on repo.

image

@junzhengca
Copy link

I am experiencing this exact same problem with v4.2

@gelashviligiorgi
Copy link

+1 v4.2 and v4.0

@bkona-alopa
Copy link

I have the same problem with the version 4.3

@allisonee
Copy link

allisonee commented Feb 16, 2024

+1, same issue v4.3

@wrainbird
Copy link

I am also getting this on v4.3

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

Successfully merging a pull request may close this issue.

9 participants