diff --git a/.github/workflows/run-check.yaml b/.github/workflows/run-check.yaml index f47c9347..ffee548e 100644 --- a/.github/workflows/run-check.yaml +++ b/.github/workflows/run-check.yaml @@ -1,5 +1,6 @@ name: Check For Stale Repositories on: + workflow_dispatch: schedule: - cron: '0 0 * * 0' jobs: @@ -10,10 +11,11 @@ jobs: matrix: go: ['1.15.x'] steps: + - uses: actions/checkout@1.0.0 - name: Get dependencies run: | go get -v -t -d ./... - name: run script run: go run test_stale_repositories.go scripts.go env: - GITHUB_OAUTH_TOKEN: ${{secrets.OAUTH_TOKEN}} \ No newline at end of file + OAUTH_TOKEN: ${{secrets.OAUTH_TOKEN}} \ No newline at end of file diff --git a/test_stale_repositories.go b/test_stale_repositories.go index 8eace2a6..84b2141a 100644 --- a/test_stale_repositories.go +++ b/test_stale_repositories.go @@ -224,7 +224,7 @@ func testStaleRepository() { query := startQuery() var staleRepos []string addressedRepositories := make(map[string]bool) - oauth := os.Getenv("GITHUB_OAUTH_TOKEN") + oauth := os.Getenv("OAUTH_TOKEN") client := &http.Client{} if oauth == "" { log.Print("No oauth token found. Using unauthenticated client ...") @@ -271,11 +271,5 @@ func testStaleRepository() { } func main() { - f, err := os.OpenFile("test_stale_repositories_log", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666) - if err != nil { - log.Println("FAILED TO INIT LOG FILE") - return - } - log.SetOutput(f) testStaleRepository() }