diff --git a/.github/actions/sync/shared-config.rb b/.github/actions/sync/shared-config.rb index dadf0bb8..fd500aed 100755 --- a/.github/actions/sync/shared-config.rb +++ b/.github/actions/sync/shared-config.rb @@ -17,6 +17,7 @@ def git(*args) target_directory = ARGV[0] target_directory_path = Pathname(target_directory) +repository_name = target_directory_path.basename.to_s homebrew_repository_path = Pathname(ARGV[1]) if !target_directory_path.directory? || !homebrew_repository_path.directory? || ARGV[2] @@ -25,6 +26,7 @@ def git(*args) ruby_version = ".ruby-version" rubocop_yml = ".rubocop.yml" +dependabot_yml = ".github/dependabot.yml" homebrew_ruby_version = (homebrew_repository_path/"Library/Homebrew/vendor/portable-ruby-version").read @@ -35,13 +37,23 @@ def git(*args) permitted_classes: [Symbol, Regexp], ) homebrew_rubocop_config = homebrew_rubocop_config_yaml.reject do |key, _| - key.match?(%r{\Arequire|inherit_from|inherit_mode|Cask/|Formula|Homebrew/|Performance/|RSpec|Sorbet/}) + key.match?(%r{\Arequire|inherit_from|inherit_mode|Cask/|Formula|Homebrew|Performance/|RSpec|Sorbet/}) end.to_yaml +custom_rubocop_repos = %w[ + ci-orchestrator + orka_api_client + ruby-macho +].freeze +custom_dependabot_repos = %w[ + brew +].freeze + puts "Detecting changes…" [ ruby_version, rubocop_yml, + dependabot_yml, ".github/workflows/lock-threads.yml", ".github/workflows/stale-issues.yml", ].each do |file| @@ -52,7 +64,13 @@ def git(*args) when ruby_version target_path.write("#{homebrew_ruby_version}\n") when rubocop_yml + next if custom_rubocop_repos.include?(repository_name) + target_path.write("#{homebrew_rubocop_config}\n") + when dependabot_yml + next if custom_dependabot_repos.include?(repository_name) + + FileUtils.cp file, target_path else FileUtils.cp file, target_path end diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f9e612bb..41e2af88 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,8 +1,49 @@ +# This file is synced from the `.github` repository, do not modify it directly. version: 2 updates: - - package-ecosystem: github-actions directory: / schedule: interval: daily + allow: + - dependency-type: all + # The actions in triage-issues.yml are updated in the Homebrew/.github repo + ignore: + - dependency-name: actions/stale + - dependency-name: dessant/lock-threads + + - package-ecosystem: bundler + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + + - package-ecosystem: npm + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + + - package-ecosystem: docker + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + + - package-ecosystem: devcontainers + directory: / + schedule: + interval: daily + allow: + - dependency-type: all + + - package-ecosystem: pip + directory: / + schedule: + interval: daily + allow: + - dependency-type: all