@@ -82,7 +82,7 @@ function updateSheet_(sheet) {
8282function updateHeaders_ ( sheet ) {
8383 var headers = [ "Ruby" , "Rails" , "Mongoid" , "Sidekiq" , "Schema" , "Slimmer" ,
8484 "govuk_publishing_components" , "govuk_app_config" ,
85- "activesupport" , "activerecord" , "Gem?" , "Has dependabot.yml?" ] ;
85+ "activesupport" , "activerecord" , "Gem?" , "Has dependabot.yml?" , "Uses Dependabot Auto-merger?" , "Dependabot Auto-Merger version" , "Auto-merging external dependencies?" ] ;
8686 sheet . getRange ( 1 , 3 , 1 , headers . length ) . setValues ( [ headers ] ) ;
8787}
8888
@@ -104,7 +104,10 @@ function updateRow_(row) {
104104 updateActiveSupportVersion_ ,
105105 updateActiveRecordVersion_ ,
106106 updateRepoType ,
107- updateDependabotyml
107+ updateDependabotyml ,
108+ updateDependabotMerger ,
109+ updateDependabotMergerVersion ,
110+ updateDependabotMergingExternalDependencies
108111 ] ;
109112
110113 updateFunctions . forEach ( function ( updateFunc , index ) {
@@ -209,13 +212,53 @@ function updateRepoType(repo, targetCell) {
209212}
210213
211214/*
212- Checks for the presence of a dependabot.yml file.
215+ Checks for a dependabot.yml file.
213216 */
214217function updateDependabotyml ( repo , targetCell ) {
215218 var hasDependabot = getFileContents_ ( `https://raw.githubusercontent.com/alphagov/${ repo } /master/.github/dependabot.yml` ) ? "Yes" : "No" ;
216219 targetCell . setValue ( hasDependabot ) ;
217220}
218221
222+ /*
223+ Checks for a govuk_dependabot_merger.yml file.
224+ */
225+ function updateDependabotMerger ( repo , targetCell ) {
226+ var yml = getFileContents_ ( "https://raw.githubusercontent.com/alphagov/" + repo + "/main/.govuk_dependabot_merger.yml" ) ;
227+
228+ if ( yml ) {
229+ targetCell . setValue ( "Yes" ) ;
230+ } else {
231+ targetCell . setValue ( "No" ) ;
232+ }
233+ }
234+ /*
235+ Checks the version of the Dependabot Automerger.
236+ */
237+ function updateDependabotMergerVersion ( repo , targetCell ) {
238+ var config = getFileContents_ ( "https://raw.githubusercontent.com/alphagov/" + repo + "/main/.govuk_dependabot_merger.yml" ) ;
239+ if ( config === undefined ) {
240+ targetCell . setValue ( "" )
241+ } else if ( config . includes ( "api_version: 2" ) ) {
242+ targetCell . setValue ( "2" )
243+ } else if ( config . includes ( "api_version: 1" ) ) {
244+ targetCell . setValue ( "1" )
245+ }
246+ }
247+
248+ /*
249+ Checks if Automerging is configured to merge external dependencies.
250+ */
251+ function updateDependabotMergingExternalDependencies ( repo , targetCell ) {
252+ var config = getFileContents_ ( "https://raw.githubusercontent.com/alphagov/" + repo + "/main/.govuk_dependabot_merger.yml" ) ;
253+ if ( config === undefined ) {
254+ targetCell . setValue ( "" )
255+ } else if ( config . includes ( "update_external_dependencies: true" ) ) {
256+ targetCell . setValue ( "Yes" )
257+ } else {
258+ targetCell . setValue ( "No" )
259+ }
260+ }
261+
219262// Fetch and update versions for various dependencies
220263function updateSidekiqVersion_ ( repo , targetCell ) {
221264 updateDependencyVersion_ ( repo , targetCell , 'sidekiq' ) ;
0 commit comments