Code Monkey home page Code Monkey logo

Comments (18)

creyD avatar creyD commented on July 20, 2024 1

I hope all bugs regarding this are resolved with version 3.0. If not, please reopen this!

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Do you have any news on this? Does it work again or could you fix it?

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Could you please try your config with prettier_version: false?

from prettier_action.

adriaandotcom avatar adriaandotcom commented on July 20, 2024

With prettier_version: false I don't get any error. Hm.

from prettier_action.

creyD avatar creyD commented on July 20, 2024

In b5eb80d I replaced the default value for prettier_version - can you please try again and confirm that it works?

from prettier_action.

adriaandotcom avatar adriaandotcom commented on July 20, 2024

I now get another error when the action needs to commit:

Commiting and pushing changes...
error: pathspec 'prettier-fix' did not match any file(s) known to git
Problem checking out the specified branch: prettier-fix
[detached HEAD 989721d] Run prettier via GitHub Action
 Author: *** <***>
 1 file changed, 1 insertion(+), 1 deletion(-)
To https://github.com/simpleanalytics/queue
 ! [rejected]        HEAD -> prettier-fix (fetch first)
error: failed to push some refs to 'https://github.com/***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Sadly I couldn't find out why this problem occurs for you. I am running this action on multiple of my own repos and it works so far.

from prettier_action.

adriaandotcom avatar adriaandotcom commented on July 20, 2024

Will keep you posted if I see it again. It's gone for me now as well.

from prettier_action.

boardfish avatar boardfish commented on July 20, 2024

I now get another error when the action needs to commit:

Commiting and pushing changes...
error: pathspec 'prettier-fix' did not match any file(s) known to git
Problem checking out the specified branch: prettier-fix
[detached HEAD 989721d] Run prettier via GitHub Action
 Author: *** <***>
 1 file changed, 1 insertion(+), 1 deletion(-)
To https://github.com/simpleanalytics/queue
 ! [rejected]        HEAD -> prettier-fix (fetch first)
error: failed to push some refs to 'https://github.com/***'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I'm getting this too. I'll try setting prettier_version to false as above.

from prettier_action.

creyD avatar creyD commented on July 20, 2024

@adriaanvanrossum Could you please send me your config yml file? Thank you!

from prettier_action.

adriaandotcom avatar adriaandotcom commented on July 20, 2024

Not sure if this is the same config as where the issue was happening though.

My workflow config file
name: Node CI Main

on:
  pull_request:
    types: [opened, synchronize]
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
      - name: Check if node is version 12
        run: |
          if [[ $(node -v | cut -d '.' -f 1 | grep -Eo '[0-9]{1,4}') -eq 12 ]];
            then
              echo "Node.js version is 12";
            else
              echo "Node.js version is not 12";
              exit 1;
          fi
        shell: bash

      - uses: actions/checkout@v2

      - name: Prettier Action on PR
        if: github.event_name == 'pull_request'
        uses: creyD/[email protected]
        with:
          prettier_version: ^2.0.5
          prettier_options: "--write {,!(static|.github)/**/}*.{js,html,json,md,yml,css,scss} static/js/**/*.js"
          commit_message: "Run prettier via GitHub Action"
          branch: ${{ github.head_ref }}
          file_pattern: "."
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Prettier Action on master
        if: github.ref == 'refs/heads/master'
        uses: creyD/[email protected]
        with:
          prettier_version: ^2.0.5
          prettier_options: "--write {,!(static|.github)/**/}*.{js,html,json,md,yml,css,scss} static/js/**/*.js"
          commit_message: "Run prettier via GitHub Action"
          branch: master
          file_pattern: "."
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - uses: harmon758/postgresql-action@v1
        with:
          postgresql version: "12"
          postgresql db: "test_ci"
          postgresql user: "test"
          postgresql password: "password"

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: npm install, and test
        run: |
          npm install
          npm test
        env:
          CI: true
          NODE_ENV: test

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Could you try the same without the ^? Please specify the version using only a number for this test!

from prettier_action.

 avatar commented on July 20, 2024

Hi @creyD ,
I am also facing issue here.
When prettier_version set to false it works fine but i want version 1.19.1.
So when i set version , i receive error:

Installing prettier...
/entrypoint.sh: line 40: 1.19.1: not found
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ [email protected]
added 1 package from 1 contributor in 0.584s
Prettifing files...

my yml file:

  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          # Make sure the actual branch is checked out when running on pull requests
          ref: ${{ github.head_ref }}

      - name: Prettify code
        uses: creyD/[email protected]
        with:
          prettier_version: '1.19.1'
          # Push back to the same branch that was checked out
          branch: ${{ github.head_ref }}
          dry: true
          # This part is also where you can pass other options, for example:
          prettier_options: --config .prettierrc --write **/*.{js,md}

from prettier_action.

 avatar commented on July 20, 2024

I did versio to this
prettier_version: 2.0.5
still getting error

/entrypoint.sh: line 40: 2.0.5: not found
Installing prettier...
/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js
+ [email protected]

from prettier_action.

creyD avatar creyD commented on July 20, 2024

Hi @creyD ,

I am also facing issue here.

When prettier_version set to false it works fine but i want version 1.19.1.

So when i set version , i receive error:


Installing prettier...

/entrypoint.sh: line 40: 1.19.1: not found

/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js

+ [email protected]

added 1 package from 1 contributor in 0.584s

Prettifing files...

my yml file:


  prettier:

    runs-on: ubuntu-latest



    steps:

      - name: Checkout

        uses: actions/checkout@v2

        with:

          # Make sure the actual branch is checked out when running on pull requests

          ref: ${{ github.head_ref }}



      - name: Prettify code

        uses: creyD/[email protected]

        with:

          prettier_version: '1.19.1'

          # Push back to the same branch that was checked out

          branch: ${{ github.head_ref }}

          dry: true

          # This part is also where you can pass other options, for example:

          prettier_options: --config .prettierrc --write **/*.{js,md}



This is another issue, as this is another problem with the install statement. Could you please try to remove the single quotes (') around your version spec?

from prettier_action.

 avatar commented on July 20, 2024

Hi @creyD ,
I am also facing issue here.
When prettier_version set to false it works fine but i want version 1.19.1.
So when i set version , i receive error:


Installing prettier...

/entrypoint.sh: line 40: 1.19.1: not found

/usr/local/bin/prettier -> /usr/local/lib/node_modules/prettier/bin-prettier.js

+ [email protected]

added 1 package from 1 contributor in 0.584s

Prettifing files...

my yml file:


  prettier:

    runs-on: ubuntu-latest



    steps:

      - name: Checkout

        uses: actions/checkout@v2

        with:

          # Make sure the actual branch is checked out when running on pull requests

          ref: ${{ github.head_ref }}



      - name: Prettify code

        uses: creyD/[email protected]

        with:

          prettier_version: '1.19.1'

          # Push back to the same branch that was checked out

          branch: ${{ github.head_ref }}

          dry: true

          # This part is also where you can pass other options, for example:

          prettier_options: --config .prettierrc --write **/*.{js,md}

This is another issue, as this is another problem with the install statement. Could you please try to remove the single quotes (') around your version spec?

Yes i did...like this
prettier_version: 2.0.5
Still the same error .

from prettier_action.

creyD avatar creyD commented on July 20, 2024

@boardfish BTW did it work for you?

from prettier_action.

boardfish avatar boardfish commented on July 20, 2024

Sorry I didn't get back to you sooner - afraid not:

error: pathspec 'dev-prettify-everything' did not match any file(s) known to git
Problem checking out the specified branch: dev-prettify-everything
[detached HEAD ae42b60] Prettified Code!
 Author: boardfish <[email protected]>
 12 files changed, 238 insertions(+), 245 deletions(-)
 rewrite bin/www (61%)
 rewrite routes/index.js (83%)
To https://github.com/boardfish/com3504-assignment
 ! [rejected]        HEAD -> dev-prettify-everything (fetch first)
error: failed to push some refs to 'https://github.com/boardfish/com3504-assignment'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details

I've got the leeway to merge in despite the action failing - master gets prettified just fine after that.

from prettier_action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.