Skip to content

Commit

Permalink
Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianwei Dong committed Jan 31, 2021
1 parent deda61b commit e79edec
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 145 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,24 @@ This command works the same as the previous one (`gh <query>`) but it limits the

This command searches within the Pull Requests that you're involved in.

If you want to limit the search to be under your organisations, please remove `PR_ALL_INVOLVE_ME` environment variable

### Open notifications: `gh-notifications`

This command just opens your [Github notification][notifications-page] page.

## Config Cache TTL

You can customise the TTL for the internal caches of Repos/Organisations/PullRequests by seting the following
environment variables. (all in seconds)

```
> CACHE_TTL_SEC_ORG default: 86400
> CACHE_TTL_SEC_PR default: 300
> CACHE_TTL_SEC_REPO default: 86400
```


## Configuring host for Enterprise

If you're using an Enterprise account, you can call the `gh-host <host>` command.
Expand Down
13 changes: 9 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ class App
class << self
def client
DataSource::Client::Github.new(
host: ENV['GITHUB_HOST'] || 'api.github.com',
access_token: ENV['GITHUB_ACCESS_TOKEN'],
cache_dir: ENV['alfred_workflow_cache']
)
host: ENV['GITHUB_HOST'] || 'api.github.com',
access_token: ENV['GITHUB_ACCESS_TOKEN'],
me_account: ENV['GITHUB_ME_ACCOUNT'] || '@me',
pr_all_involve_me: ENV['PR_ALL_INVOLVE_ME'],
cache_dir: ENV['alfred_workflow_cache'],
cache_ttl_sec_repo: (ENV['CACHE_TTL_SEC_REPO'] || (24 * 60 * 60)).to_i,
cache_ttl_sec_org: (ENV['CACHE_TTL_SEC_ORG'] || (24 * 60 * 60)).to_i,
cache_ttl_sec_pr: (ENV['CACHE_TTL_SEC_PR'] || (5 * 60)).to_i,
)
end

def repositories
Expand Down
Loading

0 comments on commit e79edec

Please sign in to comment.