MCPcopy Create free account
hub / github.com/belak/gitdir / ensureSampleOrgs

Function ensureSampleOrgs

config_ensure.go:108–140  ·  view source on GitHub ↗
(targetNode *yaml.Node)

Source from the content-addressed store, hash-verified

106}
107
108func ensureSampleOrgs(targetNode *yaml.Node) bool {
109 _, modified := targetNode.EnsureKey(
110 "orgs",
111 yaml.NewMappingNode(),
112 &yaml.EnsureOptions{
113 Comment: `
114Org repos are accessible at @org-name/repo. Note that if admins is not
115specified, the only users with admin access will be global admins. By
116default, all members of an org will have read-write access to repos. This
117can be changed with the read and write keys.
118#
119Sample org (with all options set):
120#
121vault:
122 admins:
123 - belak
124 write:
125 - some user
126 read:
127 - some-other-user
128 repos:
129 project-name-here:
130 public: false
131 write:
132 - belak
133 read:
134 - some-user
135 - some-other-user`,
136 },
137 )
138
139 return modified
140}
141
142// NOTE: this would make more sense as a map, but we want to keep the order.
143var sampleOptions = []struct {

Callers 1

ensureSampleConfigYamlFunction · 0.85

Calls 2

NewMappingNodeFunction · 0.92
EnsureKeyMethod · 0.80

Tested by

no test coverage detected