github-overlord 0.6.7__tar.gz → 0.6.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: github-overlord
3
- Version: 0.6.7
3
+ Version: 0.6.8
4
4
  Summary: Automatically merge Dependabot PRs in public repositories
5
5
  Home-page: https://github.com/iloveitaly/github-overlord
6
6
  Keywords: github,dependabot,automation
@@ -17,7 +17,7 @@ from github_overlord.stale_commenter import (
17
17
  )
18
18
  from github_overlord.utils import log
19
19
 
20
- AUTOMATIC_MERGE_MESSAGE = "Automatically merged with GitHub overlord"
20
+ AUTOMATIC_MERGE_MESSAGE = "Automatically merged with [github-overlord](https://github.com/iloveitaly/github-overlord)"
21
21
 
22
22
 
23
23
  def merge_pr(pr, dry_run):
@@ -137,7 +137,7 @@ def process_repo(repo, dry_run):
137
137
  log.info("merged prs", count=merged_pr_count)
138
138
 
139
139
 
140
- def main(token, dry_run, repo):
140
+ def merge_dependabot_prs(token, dry_run, repo):
141
141
  assert token, "GitHub token is required"
142
142
 
143
143
  g = Github(token)
@@ -157,6 +157,11 @@ def main(token, dry_run, repo):
157
157
 
158
158
  @click.group()
159
159
  def cli():
160
+ """
161
+ GitHub Overlord is a tool to help manage annoying tasks across your GitHub repositories. Some of this could be done
162
+ by GitHub Actions, but this eliminates the need to carefully configure GH actions for each repo.
163
+ """
164
+
160
165
  pass
161
166
 
162
167
 
@@ -196,7 +201,7 @@ def dependabot(token, dry_run, repo):
196
201
 
197
202
  repo = extract_repo_reference_from_github_url(repo)
198
203
 
199
- main(token, dry_run, repo)
204
+ merge_dependabot_prs(token, dry_run, repo)
200
205
 
201
206
 
202
207
  @click.command()
@@ -209,6 +214,10 @@ def dependabot(token, dry_run, repo):
209
214
  @click.option("--dry-run", is_flag=True, help="Run script without merging PRs")
210
215
  @click.option("--repo", help="Only process a single repository")
211
216
  def keep_alive_prs(token, dry_run, repo):
217
+ """
218
+ Detect when a bot is about to close a PR for no good reason and make a comment to keep it alive
219
+ """
220
+
212
221
  assert token, "GitHub token is required"
213
222
  # TODO should assert on openai setup
214
223
 
@@ -14,7 +14,9 @@ def inspect_repo_for_stale_prs(dry_run: bool, login: str, repo: Repository):
14
14
  log.debug("inspecting repo for stale PRs", repo=repo.full_name)
15
15
 
16
16
  return (
17
+ # there is not a way to filter by the user which created the PR! This take a long time on repos with many PRs
17
18
  repo.get_pulls(state="open")
19
+ # make sure the auth token user is the author of the PR
18
20
  | fp.filter(lambda pr: pr.user.login == login)
19
21
  | fp.map(fp.partial(check_for_stale_comments, dry_run))
20
22
  | fp.to_list()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "github-overlord"
3
- version = "0.6.7"
3
+ version = "0.6.8"
4
4
  description = "Automatically merge Dependabot PRs in public repositories"
5
5
  authors = ["Michael Bianco <mike@mikebian.co>"]
6
6
  readme = "README.md"