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] 4.2 fails with no such file or directory #91

Open
markstos opened this issue Feb 4, 2022 · 10 comments
Open

[BUG] 4.2 fails with no such file or directory #91

markstos opened this issue Feb 4, 2022 · 10 comments
Labels
bug Something isn't working hacktoberfest

Comments

@markstos
Copy link

markstos commented Feb 4, 2022

What exactly happened?
Steps to reproduce the behavior:

 - name: Run prettier on changed files
   uses: creyD/[email protected]
        with:
          only_changed: True
          dry: True
          prettier_options: --config ./api/.prettierrc --ignore-path ./api/.prettierignore --check ./api/src/**

What should've happened?

It should have succeeded or failed with a clear error message.
How did it look?

Run PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/github/action-runner/_work/_actions/creyD/prettier_action/v4.2/entrypoint.sh
  PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/github/action-runner/_work/_actions/creyD/prettier_action/v4.2/entrypoint.sh
  shell: bash --noprofile --norc -e -o pipefail {0}
  env:
    INPUT_COMMIT_MESSAGE: Prettified Code!
    INPUT_COMMIT_DESCRIPTION: 
    INPUT_SAME_COMMIT: false
    INPUT_COMMIT_OPTIONS: 
    INPUT_FILE_PATTERN: *
    INPUT_PRETTIER_OPTIONS: --config ./api/.prettierrc --ignore-path ./api/.prettierignore --check ./api/src/**
    INPUT_DRY: true
    INPUT_PRETTIER_VERSION: false
    INPUT_ONLY_CHANGED: true
    INPUT_PRETTIER_PLUGINS: 
    INPUT_WORKING_DIRECTORY: false
    INPUT_GITHUB_TOKEN: ***
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm timing npm Completed in 48ms
npm info ok 
/__w/_temp/cda1fe4d-556f-48b7-b555-744d14a51b4d.sh: line 1: /home/github/action-runner/_work/_actions/creyD/prettier_action/v4.2/entrypoint.sh: No such file or directory
Error: Process completed with exit code 127.

Where did you encounter the problem?

  • Version: 4.2
@dsbilling
Copy link

Got the same issue here 👍🏻

@markstos
Copy link
Author

markstos commented Feb 5, 2022

This can be debugged by forking the project and modifying -x to the "set" command at the top of entrypoint.sh:

https://github.com/creyD/prettier_action/blob/master/entrypoint.sh#L4

That will print out every bash command before it is executed, which should reveal what file is not found.

@markstos
Copy link
Author

markstos commented Feb 5, 2022

Probably the first thing that the entrypoint.sh should do when it starts is to check to make sure that all the binaries it requires from the host are present, and print an out an error and exit if they aren't find. git, npm and prettier are requirements from the host that are currently all assumed to be present.

Better not to assume anything about the host environment.

ewels added a commit to ewels/nf-core-tools that referenced this issue Mar 17, 2022
mihai-sysbio added a commit to MetabolicAtlas/MetabolicAtlas that referenced this issue Jun 28, 2022
@lnxd
Copy link

lnxd commented Feb 10, 2023

It looks like a possible solution from the user's perspective for this issue would be to use absolute paths as I mentioned in #94 (comment). There's something funny going on with relative paths.

@jimmy927
Copy link

jimmy927 commented Feb 20, 2023

solved in creyD/[email protected]

@creyD
Copy link
Owner

creyD commented Feb 20, 2023

@markstos Please try with the new version 4.3, if @jimmy927 is right, we can close this ticket.

@brandart
Copy link

@markstos Please try with the new version 4.3, if @jimmy927 is right, we can close this ticket.

it works with 4.3 👍 thanks :)

@markstos
Copy link
Author

@brandart works with me. So this "works for me", too. Thanks!

@brandart
Copy link

seems like I was wrong and thought that I ran the prettier action (which was comment out) but in the end, I ran the normal prettier. When trying it again it still fails with the same error message.

So I think this issue is not fixed then. :(

@creyD creyD reopened this Feb 21, 2023
@whoabuddy
Copy link

whoabuddy commented Feb 22, 2023

Linking what might be related issues, based on either the prettier executable not being found or a missing plugin causing failure. Are these the same environment issues?

For our use case (see this comment) we were looking to fail on check for a subfolder, everything is working locally but the action fails because it cannot find prettier.


UPDATE: upgraded to 4.3 after reading through some other comments and it now recognizes prettier in the action. It's still not working though, locally I see one file that isn't formatted correctly, but the action reports 0 files.

Does the action respect the local config files in the repo? Confused at why it's so tough just to run a check on a subfolder, more details in this PR comment: https://github.com/casey/ord/pull/1594#issuecomment-1439923087

Tritium-VLK added a commit to BalancerMaxis/multisig-ops that referenced this issue Feb 23, 2023
…atly (#83)

* Updated to prittier version 4.3 to deal with a bug described here:
creyD/prettier_action#91

* Reformatted JSON files

---------

Co-authored-by: Tritium-VLK <[email protected]>
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

No branches or pull requests

7 participants