Skip to content

Commit b76c81b

Browse files
authored
Merge pull request #21 from github/permissions
Handle pull request write failures
2 parents f43591f + a41ca6c commit b76c81b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

evergreen.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ def main(): # pragma: no cover
9090

9191
# Create a dependabot.yaml file, a branch, and a PR
9292
if not skip:
93-
pull = commit_changes(title, body, repo, dependabot_file)
94-
print("\tCreated pull request " + pull.html_url)
93+
try:
94+
pull = commit_changes(title, body, repo, dependabot_file)
95+
print("\tCreated pull request " + pull.html_url)
96+
except github3.exceptions.NotFoundError:
97+
print("\tFailed to create pull request. Check write permissions.")
98+
continue
9599

96100
print("Done. " + str(count_eligible) + " repositories were eligible.")
97101

0 commit comments

Comments
 (0)