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

Test commit #75

Merged
merged 6 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/biome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Biome Check and Fix for Web

on:
pull_request:

jobs:
biome-check-and-fix-for-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install Bun
run: npm install -g bun

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

npm install -g bun はセキュリティ上のリスクがあるため、特定のバージョンをインストールすることをお勧めします。

-         run: npm install -g bun
+         run: npm install -g bun@latest

- name: Install dependencies
run: cd web && bun i

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

依存関係のインストールに失敗した場合のエラーハンドリングが不足しています。bun i コマンドの後にエラーチェックを追加してください。

-         run: cd web && bun i
+         run: |
+           cd web
+           if ! bun i; then
+             echo "Dependency installation failed"
+             exit 1
+           fi

- name: Run Biome check and fix
run: |
cd web
bunx @biomejs/biome check --write .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Biome チェックと修正に失敗した場合のエラーハンドリングが不足しています。bunx @biomejs/biome check --write . コマンドの後にエラーチェックを追加してください。

-           bunx @biomejs/biome check --write .
+           if ! bunx @biomejs/biome check --write .; then
+             echo "Biome check and fix failed"
+             exit 1
+           fi

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: write Biome fixes"
file_pattern: 'web/**/*'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

ファイルパターンの指定が広すぎます。特定のファイルタイプに絞ることで、不要なコミットを防ぐことができます。

-           file_pattern: 'web/**/*'
+           file_pattern: 'web/**/*.js'

Loading