-
Notifications
You must be signed in to change notification settings - Fork 0
ci: 🤖 品質向上ワークフローを導入 #30
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
11 commits
Select commit
Hold shift + click to select a range
edd76b1
ci: 🤖 品質向上ワークフローを導入
genzouw 6a03db0
fix: 🐛 [Code Review] actionlintワークフローにpersist-credentials: falseを追加
genzouw 0fe8008
fix: 🐛 [Code Review] gitleaksバイナリのchecksum検証を追加
genzouw 742d615
fix: 🐛 [Code Review] PRテンプレートの箇条書きを1つに整理
genzouw 40c4b51
fix: SC2086 shellcheck警告を修正 - 変数展開にダブルクォートを追加
genzouw 67afd6a
Merge branch 'main' into chore/quality-tooling
genzouw d697e2c
fix: 🐛 [Code Review] markdownlint ignores の冗長エントリを削除
genzouw 600d249
Merge branch 'main' into chore/quality-tooling
genzouw fa0769b
Merge branch 'main' into chore/quality-tooling
genzouw 93f9f0b
fix(ci): shellcheck SC2129 - グループ化リダイレクトに変更
genzouw e9bd6c7
Merge branch 'main' into chore/quality-tooling
genzouw 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <!-- | ||
| PR の説明テンプレート。 | ||
| 該当しないセクションは削除して構いません。 | ||
| --> | ||
|
|
||
| ## 概要 | ||
|
|
||
| <!-- このPRが何を解決するか / 何を追加するかを1〜3行で。 --> | ||
|
|
||
| ## 関連 Issue | ||
|
|
||
| <!-- 例: Closes #123, Refs #456 --> | ||
|
|
||
| ## 変更内容 | ||
|
|
||
| <!-- 主要な変更点を箇条書きで。 --> | ||
|
|
||
| - | ||
|
|
||
| ## 動作確認 | ||
|
|
||
| <!-- ローカルで確認した内容、テスト結果、スクショなど。 --> | ||
|
|
||
| - [ ] ローカルで動作確認した | ||
| - [ ] テストを追加・更新した(または不要な理由を記載) | ||
|
|
||
| ## セルフチェック | ||
|
|
||
| - [ ] 既存の lint / typecheck / test がパスする | ||
| - [ ] 破壊的変更がある場合、README または docs を更新した | ||
| - [ ] secret / 個人情報を含むコードや設定が含まれていない | ||
|
|
||
| ## 補足 | ||
|
|
||
| <!-- 追加で共有しておきたいことがあれば。なければ削除。 --> |
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,45 @@ | ||
| name: actionlint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/**" | ||
| - ".github/actionlint*" | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/**" | ||
| - ".github/actionlint*" | ||
|
|
||
| concurrency: | ||
| group: actionlint-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| actionlint: | ||
| name: actionlint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Download actionlint | ||
| id: actionlint | ||
| run: | | ||
| set -euo pipefail | ||
| VERSION=1.7.7 | ||
| TARBALL="actionlint_${VERSION}_linux_amd64.tar.gz" | ||
| curl -fsSL -o "/tmp/${TARBALL}" "https://github.com/rhysd/actionlint/releases/download/v${VERSION}/${TARBALL}" | ||
| curl -fsSL -o /tmp/checksums.txt "https://github.com/rhysd/actionlint/releases/download/v${VERSION}/actionlint_${VERSION}_checksums.txt" | ||
| cd /tmp && grep "${TARBALL}" checksums.txt | sha256sum -c - | ||
| tar -xzf "/tmp/${TARBALL}" -C /tmp actionlint | ||
| echo "executable=/tmp/actionlint" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Run actionlint | ||
| run: | | ||
| "${{ steps.actionlint.outputs.executable }}" -color | ||
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,47 @@ | ||
| name: CodeQL | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # 毎週月曜 03:00 JST (= 日曜 18:00 UTC) に main を再スキャン | ||
| - cron: '0 18 * * 0' | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # frontend は tsx、backend は ts。両方とも 'javascript-typescript' でまとめてスキャン。 | ||
| language: ['javascript-typescript'] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@78ed0c7291d93e40c51b085850dc669a4c3ab73b # v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| # security-extended は誤検知が増えるため、まずは security-and-quality で運用。 | ||
| # ノイズが多い場合は 'security' に下げる。 | ||
| queries: security-and-quality | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@78ed0c7291d93e40c51b085850dc669a4c3ab73b # v3 | ||
| with: | ||
| category: '/language:${{ matrix.language }}' |
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
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,61 @@ | ||
| name: Gitleaks | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # 毎週月曜 05:00 JST (= 日曜 20:00 UTC) に履歴全体を再スキャン | ||
| - cron: "0 20 * * 0" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: gitleaks-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| jobs: | ||
| gitleaks: | ||
| name: Scan for leaked secrets | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
| with: | ||
| # 履歴全体をスキャンするためフルクローン | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Install gitleaks | ||
| run: | | ||
| set -euo pipefail | ||
| GITLEAKS_VERSION=8.21.2 | ||
| BASE_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}" | ||
| ARCHIVE="gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | ||
| curl -fsSLO "${BASE_URL}/${ARCHIVE}" | ||
| curl -fsSLO "${BASE_URL}/gitleaks_${GITLEAKS_VERSION}_checksums.txt" | ||
| grep " ${ARCHIVE}$" "gitleaks_${GITLEAKS_VERSION}_checksums.txt" | sha256sum -c - | ||
| tar -xzf "${ARCHIVE}" gitleaks | ||
| sudo mv gitleaks /usr/local/bin/gitleaks | ||
| gitleaks version | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Run gitleaks | ||
| run: | | ||
| gitleaks detect \ | ||
| --source . \ | ||
| --redact \ | ||
| --verbose \ | ||
| --no-banner \ | ||
| --exit-code 1 \ | ||
| --report-format sarif \ | ||
| --report-path gitleaks.sarif | ||
|
|
||
| - name: Upload SARIF | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@78ed0c7291d93e40c51b085850dc669a4c3ab73b # v3 | ||
| with: | ||
| sarif_file: gitleaks.sarif | ||
| category: gitleaks | ||
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,40 @@ | ||
| name: markdownlint | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - '**/*.md' | ||
| - '.markdownlint-cli2.jsonc' | ||
| - '.github/workflows/markdownlint.yml' | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - '**/*.md' | ||
| - '.markdownlint-cli2.jsonc' | ||
| - '.github/workflows/markdownlint.yml' | ||
|
|
||
| concurrency: | ||
| group: markdownlint-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| markdownlint: | ||
| name: markdownlint-cli2 | ||
| runs-on: ubuntu-latest | ||
| # 既存ドキュメントの MD040/MD031 違反を片付けるまでは赤検知にしない。 | ||
| # 整備完了後に continue-on-error を外して赤検知に切り替える。 | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run markdownlint-cli2 | ||
| uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20 | ||
| with: | ||
| config: '.markdownlint-cli2.jsonc' | ||
| globs: '**/*.md' |
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,27 @@ | ||
| { | ||
| // markdownlint-cli2 設定 | ||
| // https://github.com/DavidAnson/markdownlint-cli2 | ||
| "config": { | ||
| "default": true, | ||
| // 行長制限: コード/表/長文を伴うドキュメントが多いので無効化 | ||
| "MD013": false, | ||
| // インライン HTML: README や PR テンプレで <!-- --> やテーブル装飾を使うので許可 | ||
| "MD033": false, | ||
| // 単一の H1 を強制: 既存ドキュメントが満たさないものがあるため無効化 | ||
| "MD025": false, | ||
| // 重複ヘッダ: docs で「概要」が複数出るので緩める | ||
| "MD024": { "siblings_only": true }, | ||
| // 最初の行が H1 でなくてもよい (PR テンプレなど) | ||
| "MD041": false, | ||
| // 強調を見出しに使ってよい | ||
| "MD036": false, | ||
| // bare URL を許可 (GitHub flavored Markdown で自動リンク化される) | ||
| "MD034": false, | ||
| // テーブル列スタイル: 重要度が低いため無効化 | ||
| "MD060": false, | ||
|
genzouw marked this conversation as resolved.
|
||
| // blockquote 内の空行: 引用節を見やすくするため許可 | ||
| "MD028": false, | ||
| }, | ||
| "globs": ["**/*.md"], | ||
| "ignores": ["**/node_modules/**", ".claude/**", "**/dist/**", "**/build/**"], | ||
| } | ||
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 @@ | ||
| module.exports = { | ||
| extends: ["@commitlint/config-conventional"], | ||
| rules: { | ||
| "header-max-length": [2, "always", 70], | ||
| "scope-case": [2, "always", ["camel-case", "kebab-case", "upper-case"]], | ||
| "subject-case": [0, "always"], | ||
| "body-max-line-length": [2, "always", 120], | ||
| }, | ||
| }; |
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.