Skip to content

Commit 1a76603

Browse files
committed
github: tweak dependabot frequency
Before: * "Dependabot Security Alerts" was enabled * Security Alerts scans All contents, so it creates noisy PRs. After: * Disable "Dependabot Security Alerts". * Check github-actions in daily and create security updates PR at once. * Check bundler in daily and does not create both of security update and normal update because it will not be intended to update by dependabot.. Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent 9a93e2e commit 1a76603

2 files changed

Lines changed: 42 additions & 8 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ README.md: templates/README.md.erb
347347
/README.md.erb > README.md
348348

349349
.github/dependabot.yml: templates/dependabot.yml.erb
350-
erb $< > $@
350+
erb -T - $< > $@
351351

352352
# Generate plugins for version
353353
#

templates/dependabot.yml.erb

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
11
# AUTOMATICALLY GENERATED
22
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/dependabot.yml.erb
3+
#
4+
# DISABLE "Dependabot Security Updates" because it scans past
5+
# archived-image directory. It creates noisy PRs. We can't stop that
6+
# behavior at all.
7+
#
38
version: 2
49
updates:
510
# Maintain dependencies for GitHub Actions
611
- package-ecosystem: "github-actions"
712
directory: "/"
813
schedule:
9-
interval: "weekly"
10-
# Watch dependencies for current stable only
11-
<% latest_version = Dir.glob("docker-image/*").sort_by {|version| Gem::Version.new(version.split('/').last.delete('v'))}.last %>
12-
<% available_gemfile_paths = Dir.glob("#{latest_version}/**/Gemfile") %>
13-
<% available_gemfile_paths.each do |gemfile_path| %>
14-
<% path = File.dirname(gemfile_path) %>
14+
interval: "daily"
15+
groups:
16+
# PR: "Security update [package] from [old] to [new]"
17+
# This PR should be merged in hurry
18+
security-updates:
19+
applies-to: security-updates
20+
patterns:
21+
- "*"
22+
23+
# PR: "Bump [package] from [old] to [new]"
24+
# No need to be merged this PR in hurry. It is enough to merge
25+
# once in a month.
26+
monthly-updates:
27+
applies-to: version-updates
28+
patterns:
29+
- "*"
30+
# Allow to create PR both of security and normal updates.
31+
open-pull-requests-limit: 1
32+
33+
<%- latest_version = Dir.glob("docker-image/*").sort_by {|version| Gem::Version.new(version.split('/').last.delete('v'))}.last -%>
34+
<%- available_gemfile_paths = Dir.glob("#{latest_version}/**/Gemfile") -%>
35+
<%- available_gemfile_paths.each do |gemfile_path| -%>
36+
<%- path = File.dirname(gemfile_path) %>
37+
# security updates in daily, ignore normal updates
1538
- package-ecosystem: "bundler"
1639
directory: "/<%= path %>"
1740
schedule:
1841
interval: "daily"
42+
groups:
43+
security-updates:
44+
applies-to: security-updates
45+
patterns:
46+
- "*"
47+
ignore:
48+
- dependency-name: "*"
49+
update-types: ["version-update"]
50+
# Check [Security and quality] or [Insights] > [Dependency graph]
51+
# periodically It will help to know security issues in each
52+
# Gemfile, but no need to create PR automatically.
1953
open-pull-requests-limit: 0
20-
<% end %>
54+
<%- end -%>

0 commit comments

Comments
 (0)