Skip to content

Commit

Permalink
set date now on investigate issue title (avelino#3455)
Browse files Browse the repository at this point in the history
Signed-off-by: Avelino <[email protected]>
  • Loading branch information
avelino authored Jan 19, 2021
1 parent 779a596 commit d1d9d6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test_stale_repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ var githubGETCOMMITS = "https://api.github.com/repos%s/commits"
var githubPOSTISSUES = "https://api.github.com/repos/avelino/awesome-go/issues"
var awesomeGoGETISSUES = "http://api.github.com/repos/avelino/awesome-go/issues" //only returns open issues
var numberOfYears time.Duration = 1
var timeNow = time.Now()
var issueTitle = fmt.Sprintf("Investigate repositories with more than 1 year without update - %s", timeNow.Format("2006-01-02"))

const issueTitle = "Investigate repositories with more than 1 year without update"
const deadLinkMessage = " this repository might no longer exist! (status code >= 400 returned)"
const movedPermanently = " status code 301 received"
const status302 = " status code 302 received"
Expand Down Expand Up @@ -189,8 +190,7 @@ func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]s
func testCommitAge(toRun bool, href string, client *http.Client, staleRepos *[]string) bool {
if toRun {
var respObj []map[string]interface{}
now := time.Now()
since := now.Add(-1 * 365 * 24 * numberOfYears * time.Hour)
since := timeNow.Add(-1 * 365 * 24 * numberOfYears * time.Hour)
sinceQuery := since.Format(time.RFC3339)
ownerRepo := strings.ReplaceAll(href, "https://github.com", "")
apiCall := fmt.Sprintf(githubGETCOMMITS, ownerRepo)
Expand Down

0 comments on commit d1d9d6c

Please sign in to comment.