MCPcopy Index your code
hub / github.com/1Password/for-open-source / FileName

Method FileName

script/application.go:141–152  ·  view source on GitHub ↗

FileName takes application issue number and project name and turn it into a file path. This will always be unique because it is relying on GitHub's issue numbers e.g. 782-foo.json

()

Source from the content-addressed store, hash-verified

139// GitHub's issue numbers
140// e.g. 782-foo.json
141func (a *Application) FileName() string {
142 filename := fmt.Sprintf("%s-%s.json",
143 strconv.FormatInt(int64(a.IssueNumber), 10),
144 strings.ToLower(a.Project.Name),
145 )
146
147 filename = strings.ReplaceAll(strings.ToLower(filename), " ", "-")
148 filename = regexp.MustCompile(`[^\w.-]`).ReplaceAllString(filename, "")
149 filename = regexp.MustCompile(`-+`).ReplaceAllString(filename, "-")
150
151 return filename
152}
153
154func (a *Application) SetApprover() error {
155 approverIdValue, err := getEnv("APPROVER_ID")

Callers 3

TestApplication_FileNameFunction · 0.95
ApproveMethod · 0.80
createCommentMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestApplication_FileNameFunction · 0.76