ci: npm dependabot PRでCIを確実にスキップするラベルベース判定を追加#369
Closed
ROhta wants to merge 1 commit into
Closed
Conversation
GitHubの`[skip ci]`はコミットpushを伴わないpull_requestイベント (review_requested, ready_for_review, reopened)では公式に挙動が明示 されておらず、何らかの操作でDependency Checkが起動した場合に効か ない可能性がある。 ラベルベースのジョブレベルif条件で確実にスキップする保険を追加。 - dependabot.yml: npmエコシステムに`skip-ci`ラベルを自動付与 - dependency-review.yml: 各ジョブで`skip-ci`ラベル時にスキップ github-actions dependabot (check ci statusプレフィックス) は `skip-ci`ラベルを付けないため影響なし。CIは従来通り実行される。
Owner
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
npm Dependabot の PR で [skip ci] が pull_request の特定 types(review_requested / reopened / ready_for_review)で効かない可能性に備え、ラベルベースで Dependency Check ワークフローを確実にスキップできるようにする変更です。
Changes:
- npm dependabot の PR に
skip-ciラベルが付与されるよう Dependabot 設定を更新 Dependency Checkworkflow の各ジョブにskip-ciラベル有無によるスキップ条件を追加
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/dependency-review.yml |
PR ラベルに応じて Dependency-Review / Build-Check ジョブをスキップする条件を追加 |
.github/dependabot.yml |
npm ecosystem の Dependabot PR に skip-ci ラベルを付与する設定を追加 |
Comments suppressed due to low confidence (1)
.github/workflows/dependency-review.yml:22
- 課題:
skip-ciラベルが付与されると、Dependabot 以外の PR でもこのジョブが無条件にskippedになり、ビルド検証を意図せず回避できてしまいます。
対策案: skip-ci に加えて PR 作成者が Dependabot であること(例: github.event.pull_request.user.login が dependabot[bot])や、PR タイトルの prefix([skip ci])なども併せて判定し、一般の PR ではラベルだけでスキップできないようにしてください。
Build-Check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
runs-on: ubuntu-latest
Comment on lines
8
to
10
| Dependency-Review: | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} | ||
| runs-on: ubuntu-latest |
Owner
Author
|
方針変更: dependabot のPRでもCIを全て走らせたいため、本修正は破棄します。代わりに |
6 tasks
ROhta
added a commit
that referenced
this pull request
May 23, 2026
## 期待する挙動・状態 - npm dependabot のPR でも、 すべての CI / 外部ツールを通常通り実行する - コミットメッセージは dependabot デフォルト (例: \`Bump xxx from 1.0.0 to 1.1.0\`) ## 必要な依存関係 - なし ## 確認済み項目 - [x] github-actions エコシステムの \`check ci status\` プレフィックスは維持 (CI実行の意図のため) - [x] \`labels: [\"dependencies\"]\` は維持 (両エコシステム共通) - [x] PR #369 (label-based skip-ci 判定) は破棄済み ## 見てほしいところ - [ ] PRのLabelsの設定は適切か - [ ] github-actions の \`check ci status\` プレフィックスも統一(削除)するか、 現状維持か - [ ] dependabot がデフォルトのコミットメッセージで動作することを次回 dependabot 起動時 (npm: daily 10:00 JST) に確認 ## 背景 `[skip ci]` プレフィックスでCIをスキップする方針から、 **dependabot のPRでもCIを全て走らせる** 方針に転換。 理由: - GitHub Actions の `[skip ci]` は `pull_request` の特殊 types (`review_requested` / `ready_for_review` / `reopened`) における挙動が公式に明示されておらず信頼性に欠ける - 外部ツール (CodeQL / DeepScan / Snyk) は GitHub Actions の管轄外で `[skip ci]` の影響を受けない - 部分的にしかスキップできないなら、 一貫してすべて実行する方が混乱がない ## 変更内容 | ファイル | 変更 | |---|---| | `.github/dependabot.yml` | npm エコシステムの `commit-message` セクション (prefix `[skip ci]` + include scope) を削除 | github-actions エコシステムは既存のコミット履歴 (`check ci status(deps): bump ...`) との連続性のため変更なし。
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
期待する挙動・状態
[skip ci]) でDependency Checkworkflow を確実にスキップcheck ci status) は従来通り CI 実行必要な依存関係
確認済み項目
actionlintでワークフロー構文を検証Deploy pages(push: main) は GitHub の自動[skip ci]で既に正常スキップ済みであることを確認mainブランチに branch protection が無いため、skip-ciラベルでジョブが skipped 状態になっても auto-merge に影響しないことを確認見てほしいところ
skip-ciを skip 判定のキーにする設計でよいか(代替案:dependenciesラベルや actor 判定など)Dependency Reviewは npm 依存の脆弱性スキャンが目的だが、 npm dependabot PR で skip するトレードオフを許容するか背景
GitHub Actions の
[skip ci]はpushおよびpull_requestイベントで動作するとされているが、 公式ドキュメントは どの pull_request types で効くか を明示していない。 特にコミット push を伴わないreview_requested/ready_for_review/reopenedなどの特殊 types ではコミュニティで挙動が不安定と報告されている。このリポジトリの
dependency-review.ymlは trigger types を[review_requested, reopened, ready_for_review]に限定しており、 該当 types で何らかの操作(手動レビュアー指定など)が発生した場合に[skip ci]が効かない可能性がある。変更内容
.github/dependabot.ymllabelsにskip-ciを追加.github/workflows/dependency-review.ymlDependency-Review/Build-Check各ジョブにif: !contains(github.event.pull_request.labels.*.name, 'skip-ci')を追加検証で判明した既存挙動
Deploy pages(push: main) : npm[skip ci]PR のマージコミットに対する workflow runs を確認したところ実行されていない → GitHub の自動[skip ci]で 既に正常スキップ済み(本PRでは触らない)Dependency Check(pull_request) : 過去 30 件の workflow runs において npm dependabot PR で起動した形跡なし(trigger types がopenedを含まないため通常は発火しない)つまり今回の修正は観測された不具合への直接修正ではなく defense-in-depth の保険。
関連
[skip ci]の管轄外。 これらを止めたい場合は各サービス側の設定が必要。