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
()
| 139 | // GitHub's issue numbers |
| 140 | // e.g. 782-foo.json |
| 141 | func (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 | |
| 154 | func (a *Application) SetApprover() error { |
| 155 | approverIdValue, err := getEnv("APPROVER_ID") |
no outgoing calls