8000 Merge pull request #68 from ruby/use-regex-allow-ref-list · ruby/git.ruby-lang.org@29a5058 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29a5058

Browse files
authored
Merge pull request #68 from ruby/use-regex-allow-ref-list
Use regex for allow list of sync branches
2 parents 85f1351 + 777eb86 commit 29a5058

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cgi-bin/webhook.cgi

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ class Webhook
6262
end
6363

6464
class PushHook
65-
RUBY_SYNCED_REFS = %w[
66-
refs/heads/master
67-
refs/heads/ruby_2_7
68-
refs/heads/ruby_3_0
69-
refs/heads/ruby_3_1
70-
]
7165
DEFAULT_GEM_REPOS = %w[
7266
abbrev
7367
base64
@@ -170,7 +164,8 @@ class PushHook
170164
end
171165

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

0 commit comments

Comments
 (0)
0