Skip to content

Add a flag to disable default gem sync #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cgi-bin/webhook.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ class PushHook
].map { |repo| "ruby/#{repo}" } + %w[
rubygems/rubygems
]
# Set false to stop sync before a release
DEFAULT_GEM_SYNC_ENABLED = false

def initialize(logger:)
@logger = logger
Expand Down Expand Up @@ -177,7 +179,7 @@ class PushHook
end

def on_push_default_gem(ref, repository:, before:, after:)
if ref == 'refs/heads/master'
if ref == 'refs/heads/master' && DEFAULT_GEM_SYNC_ENABLED
# www-data user is allowed to sudo `/home/git/git.ruby-lang.org/bin/update-default-gem.sh`.
execute('/home/git/git.ruby-lang.org/bin/update-default-gem.sh', *repository.split('/', 2), before, after, user: 'git')
else
Expand Down