Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: master branch to repo["default_branch"] #350

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions adabot/arduino_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def is_arduino_library(repo):
lib_prop_file = requests.get(
"https://raw.githubusercontent.com/adafruit/"
+ repo["name"]
+ "/master/library.properties"
+ "/"
+ repo["default_branch"]
+ "/library.properties"
)
return lib_prop_file.ok

Expand Down Expand Up @@ -112,7 +114,9 @@ def validate_library_properties(repo):
lib_prop_file = requests.get(
"https://raw.githubusercontent.com/adafruit/"
+ repo["name"]
+ "/master/library.properties"
+ "/"
+ repo["default_branch"]
+ "/library.properties"
)
if not lib_prop_file.ok:
# print("{} skipped".format(repo["name"]))
Expand Down Expand Up @@ -152,22 +156,29 @@ def validate_release_state(repo):
return None

compare_tags = gh_reqs.get(
"/repos/" + repo["full_name"] + "/compare/master..." + repo["tag_name"]
"/repos/"
+ repo["full_name"]
+ "/compare/"
+ repo["default_branch"]
+ "..."
+ repo["tag_name"]
)
if not compare_tags.ok:
logger.error(
"Error: failed to compare %s 'master' to tag '%s'",
"Error: failed to compare %s '%s' to tag '%s'",
repo["name"],
repo["default_branch"],
repo["tag_name"],
)
return None
compare_tags_json = compare_tags.json()
if "status" in compare_tags_json:
if compare_tags.json()["status"] != "identical":
if compare_tags_json["status"] != "identical":
return [repo["tag_name"], compare_tags_json["behind_by"]]
elif "errors" in compare_tags_json:
logger.error(
"Error: comparing latest release to 'master' failed on '%s'. Error Message: %s",
"Error: comparing latest release to '%s' failed on '%s'. Error Message: %s",
repo["default_branch"],
repo["name"],
compare_tags_json["message"],
)
Expand All @@ -180,7 +191,9 @@ def validate_actions(repo):
repo_has_actions = requests.get(
"https://raw.githubusercontent.com/adafruit/"
+ repo["name"]
+ "/master/.github/workflows/githubci.yml"
+ "/"
+ repo["default_branch"]
+ "/.github/workflows/githubci.yml"
)
return repo_has_actions.ok

Expand Down