From b2c97cea505b71b9142c182fc740b9eac857f5c0 Mon Sep 17 00:00:00 2001 From: Naki-ym <81948866+ymnao@users.noreply.github.com> Date: Sun, 19 Jul 2026 02:18:25 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20docs-only=20=E5=A4=89=E6=9B=B4=E3=81=A7?= =?UTF-8?q?=20CI=20=E5=85=A8=20job=20=E3=82=92=20skip=20=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ci.yml の push / pull_request に paths-ignore (**/*.md, docs/**, .github/ISSUE_TEMPLATE/**) を追加 - ci-skip.yml を新規追加: 補完する paths filter で trigger され、 ci.yml の各 required check (lint / typecheck / test / e2e / electron-e2e / build / dependency-review) を stub success で提供 - codeql.yml + codeql-skip.yml と同じ pattern・同じ path 定義で揃える - HANDOFF §1 対応 (PR #356 の CLAUDE.md 1 行追記でも e2e 全 job が 走った件を解消) --- .github/workflows/ci-skip.yml | 75 +++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 +++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/ci-skip.yml diff --git a/.github/workflows/ci-skip.yml b/.github/workflows/ci-skip.yml new file mode 100644 index 0000000..8086c8d --- /dev/null +++ b/.github/workflows/ci-skip.yml @@ -0,0 +1,75 @@ +# ci.yml が paths-ignore で skip される PR (docs-only など) のための stub。 +# branch protection で ci.yml の各 job (lint / typecheck / test / e2e / electron-e2e / +# build / dependency-review) を必須 check に指定している関係上、実 CI workflow が +# trigger されないと永遠に pending → BLOCKED になる (paths-ignore で skip された +# 必須 check は GitHub 仕様上 "neutral" ではなく未生成扱い)。 +# +# 本 workflow は ci.yml の paths-ignore と完全に補完する paths filter で trigger され、 +# 同名の check を success として作成する。 +# +# 参考: GitHub 公式トラブルシュート +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/troubleshooting-required-status-checks#handling-skipped-but-required-checks +# +# code + docs 混在 PR では ci.yml と本 workflow が両方 trigger される +# (paths-ignore は「全ファイルが ignore patterns に該当」のみ skip、paths は「1 つでも該当」で trigger)。 +# その場合は両方の同名 check が success である必要があるが、本 stub は数秒で完了するため実害なし。 +name: CI (paths-skip stub) + +on: + pull_request: + branches: [main] + paths: + # ci.yml の paths-ignore と完全一致させる (補完関係を維持) + - "**/*.md" + - "docs/**" + - ".github/ISSUE_TEMPLATE/**" + push: + branches: [main] + paths: + - "**/*.md" + - "docs/**" + - ".github/ISSUE_TEMPLATE/**" + +permissions: + contents: read + +jobs: + # job 名は ci.yml と完全一致させる (必須 check 名は job 名で参照されるため)。 + lint: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml lint skipped, marking success" + + typecheck: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml typecheck skipped, marking success" + + test: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml test skipped, marking success" + + e2e: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml e2e skipped, marking success" + + electron-e2e: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml electron-e2e skipped, marking success" + + build: + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml build skipped, marking success" + + # dependency-review は PR trigger 限定 (ci.yml でも同じ if 条件)。 + # push trigger には PR diff の概念が無く、実 workflow もこの job を出さないため + # stub 側でも PR 限定にして parity を保つ。 + dependency-review: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - run: echo "docs-only diff — ci.yml dependency-review skipped, marking success" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52cda5b..f9093ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,19 @@ name: CI on: push: branches: [main] + # docs-only 変更では実行対象コードが無いため全 job を skip する。 + # branch protection の required checks は ci-skip.yml が stub success で補完する + # (codeql.yml + codeql-skip.yml と同じ pattern、path 定義も揃える)。 + paths-ignore: + - "**/*.md" + - "docs/**" + - ".github/ISSUE_TEMPLATE/**" pull_request: branches: [main] + paths-ignore: + - "**/*.md" + - "docs/**" + - ".github/ISSUE_TEMPLATE/**" workflow_call: permissions: