Skip to content

Commit

Permalink
Fix a bug with source owner
Browse files Browse the repository at this point in the history
  • Loading branch information
samueljmello committed Jul 25, 2023
1 parent 18c264e commit 3a4e00a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type repositoryNode struct {
}
type repository struct {
Name string
Owner string
NameWithOwner string
Visibility string
TargetVisibility string
Expand Down Expand Up @@ -1002,6 +1003,7 @@ func GetRepositories(restClient api.RESTClient, graphqlClient api.GQLClient, own
for _, repoNode := range query.Organization.Repositories.Nodes {
var repoClone repository
repoClone.Name = repoNode.Name
repoClone.Owner = repoNode.Owner.Login
repoClone.NameWithOwner = repoNode.NameWithOwner
repoClone.Visibility = repoNode.Visibility
repoLookup = append(repoLookup, repoClone)
Expand Down Expand Up @@ -1084,23 +1086,27 @@ func ProcessIssues(client api.RESTClient, targetOrg string, reposToProcess []rep

// create a template for the issue
issueTemplate := "# Audit Results\n"
now := time.Now()
tz, _ := now.Zone()
issueTemplate += fmt.Sprintf(
"Audit last performed on %s at %s.\n\n",
time.Now().Format("2006-01-02"),
time.Now().Format("15:04:05"),
"Audit last performed on %s at %s %s.\n\n",
now.Format("2006-01-02"),
now.Format("15:04:05"),
tz,
)
issueTemplate += "See below for migration details and whether "
issueTemplate += "you need to mitigate any items.\n\n"
issueTemplate += "## Details\n"
issueTemplate += "- **Migrated From:** %s\n"
issueTemplate += "- **Migrated From:** [%s](https://github.com/%s)\n"
issueTemplate += "- **Source Visibility:** %s\n\n"
issueTemplate += "## Items From Source\n"
issueTemplate += "- Variables: `%+v`\n"
issueTemplate += "- Secrets: `%+v`\n"
issueTemplate += "- Environments: `%+v`\n"
issueBody := fmt.Sprintf(
issueTemplate,
targetOrg,
repository.Owner,
repository.Owner,
repository.Visibility,
repository.Variables,
repository.Secrets,
Expand Down

0 comments on commit 3a4e00a

Please sign in to comment.