@@ -84,7 +84,9 @@ def is_arduino_library(repo):
84
84
lib_prop_file = requests .get (
85
85
"https://raw.githubusercontent.com/adafruit/"
86
86
+ repo ["name" ]
87
- + "/master/library.properties"
87
+ + "/"
88
+ + repo ["default_branch" ]
89
+ + "/library.properties"
88
90
)
89
91
return lib_prop_file .ok
90
92
@@ -112,7 +114,9 @@ def validate_library_properties(repo):
112
114
lib_prop_file = requests .get (
113
115
"https://raw.githubusercontent.com/adafruit/"
114
116
+ repo ["name" ]
115
- + "/master/library.properties"
117
+ + "/"
118
+ + repo ["default_branch" ]
119
+ + "/library.properties"
116
120
)
117
121
if not lib_prop_file .ok :
118
122
# print("{} skipped".format(repo["name"]))
@@ -152,22 +156,29 @@ def validate_release_state(repo):
152
156
return None
153
157
154
158
compare_tags = gh_reqs .get (
155
- "/repos/" + repo ["full_name" ] + "/compare/master..." + repo ["tag_name" ]
159
+ "/repos/"
160
+ + repo ["full_name" ]
161
+ + "/compare/"
162
+ + repo ["default_branch" ]
163
+ + "..."
164
+ + repo ["tag_name" ]
156
165
)
157
166
if not compare_tags .ok :
158
167
logger .error (
159
- "Error: failed to compare %s 'master ' to tag '%s'" ,
168
+ "Error: failed to compare %s '%s ' to tag '%s'" ,
160
169
repo ["name" ],
170
+ repo ["default_branch" ],
161
171
repo ["tag_name" ],
162
172
)
163
173
return None
164
174
compare_tags_json = compare_tags .json ()
165
175
if "status" in compare_tags_json :
166
- if compare_tags . json () ["status" ] != "identical" :
176
+ if compare_tags_json ["status" ] != "identical" :
167
177
return [repo ["tag_name" ], compare_tags_json ["behind_by" ]]
168
178
elif "errors" in compare_tags_json :
169
179
logger .error (
170
- "Error: comparing latest release to 'master' failed on '%s'. Error Message: %s" ,
180
+ "Error: comparing latest release to '%s' failed on '%s'. Error Message: %s" ,
181
+ repo ["default_branch" ],
171
182
repo ["name" ],
172
183
compare_tags_json ["message" ],
173
184
)
@@ -180,7 +191,9 @@ def validate_actions(repo):
180
191
repo_has_actions = requests .get (
181
192
"https://raw.githubusercontent.com/adafruit/"
182
193
+ repo ["name" ]
183
- + "/master/.github/workflows/githubci.yml"
194
+ + "/"
195
+ + repo ["default_branch" ]
196
+ + "/.github/workflows/githubci.yml"
184
197
)
185
198
return repo_has_actions .ok
186
199
0 commit comments