8000 Use regex for allow list of sync branches by hsbt · Pull Request #68 · ruby/git.ruby-lang.org · GitHub
[go: up one dir, main page]

Skip to content

Use regex for allow list of sync branches #68

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
Feb 8, 2023
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
9 changes: 2 additions & 7 deletions cgi-bin/webhook.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ class Webhook
end

class PushHook
RUBY_SYNCED_REFS = %w[
refs/heads/master
refs/heads/ruby_2_7
refs/heads/ruby_3_0
refs/heads/ruby_3_1
]
DEFAULT_GEM_REPOS = %w[
abbrev
base64
Expand Down Expand Up @@ -170,7 +164,8 @@ class PushHook
end

def on_push_ruby(ref, pusher:)
if RUBY_SYNCED_REFS.include?(ref) && pusher != 'matzbot' # matzbot should stop an infinite loop here.
# Allow to sync like ruby_3_0, ruby_3_1, and master branches.
if (ref == "refs/heads/master" || ref =~ /refs\/heads\/ruby_\d_\d/) && pusher != 'matzbot' # matzbot should stop an infinite loop here.
# www-data user is allowed to sudo `/home/git/git.ruby-lang.org/bin/update-ruby.sh`.
execute('/home/git/git.ruby-lang.org/bin/update-ruby.sh', File.basename(ref), user: 'git')
else
Expand Down
0