-
Notifications
You must be signed in to change notification settings - Fork 71
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
Manage GitHub settings via Probot #654
base: master
Are you sure you want to change the base?
Changes from 2 commits
85cbed8
2cee4c2
e141442
ce9f1e3
d3a3171
b03dd16
87b74d2
aef8dea
9c738c3
e77e6f5
be28ac3
1336e19
0378109
78289bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||||||||||||||||||||
<% if @configs['repository'] -%> | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another thought for this file: data = {}
['repository', 'labels', 'branches'].each do |key|
data[key] = @configs[key] if @configs[key]
end
-%>
<%= data.to_yaml %> Edit: even shorter: <%= @configs.slice('repository', 'labels', 'branches').to_yaml %> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is what I was looking for, but it was so late. However |
||||||||||||||||||||||||
repository: | ||||||||||||||||||||||||
<% @configs['repository'].each do |key, value| -%> | ||||||||||||||||||||||||
<%= key %>: <%= value %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if @configs['labels'] -%> | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
labels: | ||||||||||||||||||||||||
<% @configs['labels'].each do |label| -%> | ||||||||||||||||||||||||
- name: <%= label['name'] %> | ||||||||||||||||||||||||
<% label.keys.each do |k| -%> | ||||||||||||||||||||||||
<% next if k == 'name' -%> | ||||||||||||||||||||||||
<%= k %>: <%= label[k] %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if delete is pretty, but I think it works:
Suggested change
|
||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if @configs['branches'] -%> | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
branches: | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am pretty sure that this can be done easier. |
||||||||||||||||||||||||
<% @configs['branches'].each do |branch| -%> | ||||||||||||||||||||||||
- name: <%= branch['name'] %> | ||||||||||||||||||||||||
<% branch.keys.each do |k| -%> | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also iterate over the tuples
Suggested change
This avoids the whole |
||||||||||||||||||||||||
<% next if k == 'name' -%> | ||||||||||||||||||||||||
<%= k %>: | ||||||||||||||||||||||||
<% if branch[k].has_key?('required_pull_request_reviews') -%> | ||||||||||||||||||||||||
<% if branch[k]['required_pull_request_reviews'].nil? -%> | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||
required_pull_request_reviews: null | ||||||||||||||||||||||||
<% else -%> | ||||||||||||||||||||||||
required_pull_request_reviews: | ||||||||||||||||||||||||
required_approving_review_count: <%= branch[k]['required_pull_request_reviews']['required_approving_review_count'] %> | ||||||||||||||||||||||||
dismiss_stale_reviews: <%= branch[k]['required_pull_request_reviews']['dismiss_stale_reviews'] %> | ||||||||||||||||||||||||
require_code_owner_reviews: <%= branch[k]['required_pull_request_reviews']['require_code_owner_reviews'] %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if branch[k].has_key?('required_status_checks') -%> | ||||||||||||||||||||||||
required_status_checks: | ||||||||||||||||||||||||
strict: <%= branch[k]['required_status_checks']['strict'] %> | ||||||||||||||||||||||||
contexts: <%= branch[k]['required_status_checks']['contexts'] %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if branch[k].has_key?('enforce_admins') -%> | ||||||||||||||||||||||||
enforce_admins: <%= branch[k]['enforce_admins'] || 'null' %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if branch[k].has_key?('restrictions') -%> | ||||||||||||||||||||||||
restrictions: <%= branch[k]['restrictions'] || 'null' %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% if branch[k].has_key?('required_signatures') -%> | ||||||||||||||||||||||||
required_signatures: <%= branch[k]['required_signatures'] %> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> | ||||||||||||||||||||||||
<% end -%> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.github/settings.yml @voxpupuli/project-maintainers | ||
|
||
* @voxpupuli/collaborators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe out of scope for this specific PR, but has there been discussion of changing the default branch name to main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK there has not been any discussion on this.