-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 複数リポジトリの共通設定をテンプレート化 #670
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de6301d
feat: 複数リポジトリの共通設定をテンプレート化
github-actions[bot] a9a8294
fix: コードレビュー指摘事項を修正
github-actions[bot] ff23440
fix: コードレビュー指摘を修正(YAML パターン追加・claude.yml 改善)
github-actions[bot] dc56f63
fix: pre-push テストフラグ汎用化・claude.yml セキュリティ強化
github-actions[bot] 5a44c79
fix: lintstagedrc-prettier-only に css パターンを追加
github-actions[bot] 954ba0d
fix: pre-push フックのエラー出力を復元(2>/dev/null を除去)
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| npx --no -- commitlint --edit "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/sh | ||
|
|
||
| # lint-staged: フォーマット・リント | ||
| npx lint-staged || exit 1 | ||
|
|
||
| # ファイル長チェック(script/check-file-length.sh が存在する場合のみ) | ||
| if [ -f script/check-file-length.sh ]; then | ||
| bash script/check-file-length.sh || exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/bin/sh | ||
|
|
||
| echo "Pre-push checks..." | ||
|
|
||
| # TypeScript 型チェック(スクリプト未定義時はスキップ) | ||
| if npm run typecheck --if-present; then | ||
| echo "-> TypeScript check passed" | ||
| else | ||
| echo "TypeScript check failed"; exit 1 | ||
| fi | ||
|
|
||
| # Lint(スクリプト未定義時はスキップ) | ||
| if npm run lint --if-present; then | ||
| echo "-> Lint passed" | ||
| else | ||
| echo "Lint failed"; exit 1 | ||
| fi | ||
|
|
||
| # テスト(スクリプト未定義時はスキップ) | ||
| if npm run --if-present test; then | ||
| echo "-> Tests passed" | ||
| else | ||
| echo "Tests failed"; exit 1 | ||
| fi | ||
|
|
||
| echo "All pre-push checks passed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "*.{ts,tsx,js,jsx}": ["biome check --fix --no-errors-on-unmatched"], | ||
| "*.{json,md}": ["biome format --write --no-errors-on-unmatched"], | ||
| "*.{yaml,yml}": ["prettier --write"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "*.{ts,tsx}": ["eslint --fix", "prettier --write"], | ||
| "*.{js,jsx,mjs,cjs}": ["eslint --fix", "prettier --write"], | ||
| "*.{json,css,md,yml,yaml}": ["prettier --write"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "*.{js,jsx,ts,tsx,css,md,json,yaml,yml}": ["prettier --write"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| .next/ | ||
| out/ | ||
| dist/ | ||
| build/ | ||
| coverage/ | ||
|
|
||
| # Lock files | ||
| package-lock.json | ||
| pnpm-lock.yaml | ||
| yarn.lock | ||
|
|
||
| # Environment | ||
| .env | ||
| .env.* | ||
|
|
||
| # IDE / OS | ||
| .vscode/ | ||
| .idea/ | ||
| .DS_Store | ||
|
|
||
| # Claude Code | ||
| .claude/settings.local.json | ||
|
|
||
| # Terraform | ||
| *.tfstate | ||
| *.tfstate.* | ||
| .terraform/ | ||
|
|
||
| # Supabase | ||
| supabase/.temp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "trailingComma": "all", | ||
| "printWidth": 80, | ||
| "endOfLine": "lf", | ||
| "arrowParens": "avoid", | ||
| "bracketSpacing": true, | ||
| "bracketSameLine": false, | ||
| "quoteProps": "as-needed", | ||
| "jsxSingleQuote": true, | ||
| "overrides": [ | ||
| { | ||
| "files": "*.json", | ||
| "options": { | ||
| "singleQuote": false | ||
| } | ||
| }, | ||
| { | ||
| "files": "*.md", | ||
| "options": { | ||
| "proseWrap": "preserve" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| { | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "trailingComma": "all", | ||
| "printWidth": 120, | ||
| "endOfLine": "lf", | ||
| "arrowParens": "always", | ||
| "bracketSpacing": true, | ||
| "bracketSameLine": false, | ||
| "quoteProps": "as-needed", | ||
| "jsxSingleQuote": false, | ||
| "overrides": [ | ||
| { | ||
| "files": "*.json", | ||
| "options": { | ||
| "singleQuote": false | ||
| } | ||
| }, | ||
| { | ||
| "files": "*.md", | ||
| "options": { | ||
| "proseWrap": "preserve" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Claude Code ワークフロー | ||
| # | ||
| # Issue や PR で @claude をメンションすると Claude Code が応答する。 | ||
| # Bot からのイベントは自動除外。 | ||
| # PR イベント(pull_request_review_comment / pull_request_review)では Draft PR も除外。 | ||
| # issue_comment イベントでは Draft 判定不可のため除外なし。 | ||
| # | ||
| # 使い方: | ||
| # .github/workflows/claude.yml にコピーして配置 | ||
| # リポジトリ Secret に CLAUDE_CODE_OAUTH_TOKEN を設定 | ||
| # | ||
| # カスタマイズ: | ||
| # - timeout-minutes: タイムアウト(デフォルト: 20分) | ||
| # - allowed_tools: Claude に許可するツール | ||
| # - claude_args: 追加の system prompt 等 | ||
| # | ||
| name: Claude Code | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| issues: | ||
| types: [opened] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| # イベント種別 + トリガーのコメント/レビューIDを含めることで、 | ||
| # 同一 PR/Issue 内でも異なるメンションが互いをキャンセルしない | ||
| group: >- | ||
| claude-${{ github.repository }}-${{ | ||
| github.event.issue.number | ||
| || github.event.pull_request.number | ||
| || github.run_id | ||
| }}-${{ | ||
| github.event.comment.id | ||
| || github.event.review.id | ||
| || github.run_id | ||
| }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| claude: | ||
| # Bot 全般を除外し、信頼済み Association のみ許可 | ||
| # OWNER / MEMBER / COLLABORATOR: リポジトリ管理者・チームメンバー・招待コラボレーター | ||
| if: | | ||
| github.event.sender.type != 'Bot' && | ||
| contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), | ||
| github.event.comment.author_association || | ||
| github.event.review.author_association || | ||
| github.event.issue.author_association | ||
| ) && | ||
| ( | ||
| (github.event_name == 'issue_comment' && contains(github.event.comment.body || '', '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body || '', '@claude') && | ||
| github.event.pull_request.draft == false) || | ||
| (github.event_name == 'pull_request_review' && contains(github.event.review.body || '', '@claude') && | ||
| github.event.pull_request.draft == false) || | ||
| (github.event_name == 'issues' && (contains(github.event.issue.body || '', '@claude') || contains(github.event.issue.title || '', '@claude'))) | ||
| ) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| id-token: write | ||
| actions: read | ||
| checks: read | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@6e2bd52842c65e914eba5c8badd17560bd26b5de # v1.0.89 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
|
|
||
| additional_permissions: | | ||
| actions: read | ||
| checks: read | ||
|
|
||
| settings: | | ||
| { | ||
| "permissions": { | ||
| "allowedTools": [ | ||
| "Bash(gh:*)", | ||
| "Bash(git:*)", | ||
| "Bash(npm:*)", | ||
| "Bash(pnpm:*)", | ||
| "Bash(npx:*)" | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| claude_args: | | ||
| --system-prompt "When working on GitHub Issues (not PRs), after completing all code changes and pushing to a branch, you MUST create a Pull Request by running 'gh pr create' command. Do not just provide a link - actually execute the gh pr create command to create the PR automatically." | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.