From 307f068db9547e80e3a90e84d63fd96adfeabc14 Mon Sep 17 00:00:00 2001 From: TTMK7777 Date: Mon, 3 Aug 2026 12:36:27 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=A4=9C=E8=A8=BC=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92=E6=96=B0=E8=A8=AD?= =?UTF-8?q?=EF=BC=88automerge=20=E3=81=AE=E7=84=A1=E6=A4=9C=E8=A8=BC?= =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=B8=E3=82=92=E5=A1=9E=E3=81=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dependabot-automerge.yml が `gh pr merge --auto --squash` を打っているが、 branch protection の required status checks が未設定のため 「待つ対象が無く即マージ」=依存更新が一切検証されずに取り込まれていた。 automerge ワークフロー自体は success を返すので外形上は正常に見える。 codeql.yml はセキュリティスキャンであってビルド/テストの門番ではない。 同種の穴があった jan-anime-map では react/react-dom の版ずれで 2 テストスイートが長期間 fail していたのに誰も気づいていなかった。 このワークフロー単体では automerge は止まらない。 マージ後に required status checks へ job 名を登録するまでが 1 セット。 --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..eaf6372 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +# CI — テストの門番 +# +# 経緯: このリポジトリは dependabot-automerge.yml で非 major の依存更新を +# 自動マージしているが、required status checks が未設定だった。 +# 既存の workflow は +# - codeql.yml : セキュリティスキャン +# - pip-audit.yml: 依存の脆弱性スキャン +# - validate.yml : validator.py --git-diff(差分の自作ルール検査) +# のいずれもビルド・テストの門番ではなく、tests/ (57 テスト) は +# CI で一度も実行されていなかった。つまり依存更新が「テストされずに」 +# マージされ得る状態だった(同種の穴で jan-anime-map では版ずれによる +# テスト失敗が長期間気づかれなかった)。 +# この workflow の job 名を required status check に登録すること。 +name: CI + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: "3.12" + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest + + - name: Run tests + run: python -m pytest tests/ -q