フォーマットのためのGitHubActions #261
Replies: 8 comments 25 replies
-
そもそも現状どうなっているか
package.json "lint-staged": {
"*.{vue, ts, js}": "eslint --fix",
"*.{js,jsx,ts,tsx,vue,css,html,md,json,cjs}": "prettier --write"
} 参考 |
Beta Was this translation helpful? Give feedback.
-
GitHubActionsをしたあとに、再びコミットしようとしたら発生したエラー# list-stagedを準備スタート
[STARTED] Preparing lint-staged...
# list-staged 準備できた
[COMPLETED] Preparing lint-staged...
# ステージされたファイルに対してタスクを実行 -> tasks がなんなのか? -> たぶん package.jsonに書かれたこと? -> 調査
[STARTED] Running tasks for staged files...
[STARTED] package.json — 1 file
[STARTED] *.{vue, ts, js} — 0 files
[STARTED] *.{js,jsx,ts,tsx,vue,css,html,md,json,cjs} — 1 file
[SKIPPED] *.{vue, ts, js} — no files
# Prettier のフォーマット開始
[STARTED] prettier --write
# Prettier のフォーマット終了
[COMPLETED] prettier --write
[COMPLETED] *.{js,jsx,ts,tsx,vue,css,html,md,json,cjs} — 1 file
[COMPLETED] package.json — 1 file
[COMPLETED] Running tasks for staged files...
# タスクからの修正を適応
[STARTED] Applying modifications from tasks...
# 失敗:
[FAILED] Prevented an empty git commit!
[STARTED] Reverting to original state because of errors...
[COMPLETED] Reverting to original state because of errors...
[STARTED] Cleaning up temporary files...
[COMPLETED] Cleaning up temporary files...
⚠ lint-staged prevented an empty git commit.
Use the --allow-empty option to continue, or check your task configuration
husky - pre-commit script failed (code 1) |
Beta Was this translation helpful? Give feedback.
-
GitHubActionsでのエラー
|
Beta Was this translation helpful? Give feedback.
-
format.ymlname: Format Code
on:
# プルリクエストが開かれた時に実行する
pull_request:
types:
- opened
# 手動でも実行できるようにする
workflow_dispatch:
# 作業内容
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Node.js をセット
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# npm install で依存関係をインストール
- name: Install dependencies
run: npm install
- name: Run Prettier
run: npm run format
- name: Run Linter
run: npm run lint
- name: Check for formatting changes
run: git diff --exit-code
continue-on-error: true |
Beta Was this translation helpful? Give feedback.
-
現状
|
Beta Was this translation helpful? Give feedback.
-
「git diff –exit-code」が不要なのかもです!
これだけでは、フォーマットに対してコミットが積まれていない感じかもです |
Beta Was this translation helpful? Give feedback.
-
とりあえず変更してみて 以下、疑問点、知りたいこと。
|
Beta Was this translation helpful? Give feedback.
-
#263 マージした結果、エラーに。 とりあえずGPTにいれてみたところ、こういうことだった。 このエラーメッセージは、GitHub Actionsが
この問題を解決するには、次のステップを試してみてください:
これで問題が解決するはずです。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
色々調査、情報整理のために書いていきます
related
関係あるかわからないが気になった記事
Beta Was this translation helpful? Give feedback.
All reactions