Skip to content

Commit

Permalink
Add check for dependabot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholsj authored Jun 19, 2023
1 parent 799c086 commit b5c97ac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps-script/Code.gs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function updateHeaders_(sheet) {
sheet.getRange(1, 10).setValue("activesupport");
sheet.getRange(1, 11).setValue("activerecord");
sheet.getRange(1, 12).setValue("Gem?");
sheet.getRange(1, 13).setValue("Has dependabot.yml?");
}

function updateRow_(row) {
Expand All @@ -61,6 +62,7 @@ function updateRow_(row) {
updateActiveSupportVersion_(repo, row.offset(0,9,1,1));
updateActiveRecordVersion_(repo, row.offset(0,10,1,1));
updateRepoType(repo, row.offset(0,11,1,1));
updateDependabotyml(repo, row.offset(0,12,1,1));
}
}

Expand Down Expand Up @@ -241,6 +243,15 @@ function updateRepoType(repo, targetCell) {
}
}

function updateDependabotyml(repo, targetCell) {
var dependabotyml = getFileContents_("https://raw.githubusercontent.com/alphagov/" + repo + "/master/.github/dependabot.yml");
if (dependabotyml) {
targetCell.setValue("Yes");
} else {
targetCell.setValue("No");
}
}

function getFileContents_(url) {
var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
switch(response.getResponseCode()) {
Expand Down

0 comments on commit b5c97ac

Please sign in to comment.