Comments (18)
I hope all bugs regarding this are resolved with version 3.0. If not, please reopen this!
from prettier_action.
Do you have any news on this? Does it work again or could you fix it?
from prettier_action.
Could you please try your config with prettier_version: false
?
from prettier_action.
With prettier_version: false
I don't get any error. Hm.
from prettier_action.
In b5eb80d I replaced the default value for prettier_version - can you please try again and confirm that it works?
from prettier_action.
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.
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.
Will keep you posted if I see it again. It's gone for me now as well.
from prettier_action.
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.
@adriaanvanrossum Could you please send me your config yml file? Thank you!
from prettier_action.
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.
Could you try the same without the ^? Please specify the version using only a number for this test!
from prettier_action.
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.
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.
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.
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.
@boardfish BTW did it work for you?
from prettier_action.
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)
- [BUG] Problem running prettier in workflow HOT 5
- [BUG] Doesn't fail on infer parser failed HOT 4
- [BUG] Shouldn't delete node_modules HOT 8
- [BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php'
- [BUG] Cannot find module 'prettier-plugin-tailwindcss' HOT 11
- [BUG] `prettier` not installed correctly HOT 9
- [BUG] prettier: command not found HOT 3
- [BUG] Problem --writer HOT 4
- [BUG] Process completed with exit code 1 HOT 5
- [BUG] Example not working. HOT 4
- IDEA: Add push_options parameter HOT 3
- [BUG] Error: Process completed with exit code 1 when using prettier-php HOT 12
- [BUG] Code style issues found, can't reproduce locally HOT 2
- [FEATURE] Format only changed lines not the whole file HOT 1
- [BUG] Should work when package-lock.json is not versioned HOT 3
- [FEATURE] Don't log unchanged files
- [BUG] Dry run fails in spite of the fact that a line length does not exceed 80 chars. HOT 2
- What is status code 128? HOT 5
- Readme out of date
- [FEATURE] Print the `prettier` command to be executed before executing it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier_action.