File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
extension/tasks/dependabotV2/utils/dependabot Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,40 @@ function parseUpdates(config: any): IDependabotUpdate[] {
150
150
throw new Error ( "The value 'package-ecosystem' in dependency update config is missing" ) ;
151
151
}
152
152
153
+ // Remap the package ecyosystem name from config to a value that dependabot-core/cli understands.
154
+ // Config values: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
155
+ // Core/CLI values: https://github.com/dependabot/dependabot-core/blob/main/common/lib/dependabot/config/file.rb
156
+ dependabotUpdate [ 'package-ecosystem' ] = ( ( ) => {
157
+ const ecosystem = dependabotUpdate [ 'package-ecosystem' ] . toLowerCase ( ) ;
158
+ switch ( ecosystem ) {
159
+ case 'devcontainer' :
160
+ return 'devcontainers' ;
161
+ case 'github-actions' :
162
+ return 'github_actions' ;
163
+ case 'gitsubmodule' :
164
+ return 'submodules' ;
165
+ case 'gomod' :
166
+ return 'go_modules' ;
167
+ case 'mix' :
168
+ return 'hex' ;
169
+ case 'npm' :
170
+ return 'npm_and_yarn' ;
171
+ // Additional aliases, for convenience
172
+ case 'pipenv' :
173
+ return 'pip' ;
174
+ case 'pip-compile' :
175
+ return 'pip' ;
176
+ case 'poetry' :
177
+ return 'pip' ;
178
+ case 'pnpm' :
179
+ return 'npm_and_yarn' ;
180
+ case 'yarn' :
181
+ return 'npm_and_yarn' ;
182
+ default :
183
+ return ecosystem ;
184
+ }
185
+ } ) ( ) ;
186
+
153
187
// zero is a valid value
154
188
if ( ! dependabotUpdate [ 'open-pull-requests-limit' ] && dependabotUpdate [ 'open-pull-requests-limit' ] !== 0 ) {
155
189
dependabotUpdate [ 'open-pull-requests-limit' ] = 5 ;
You can’t perform that action at this time.
0 commit comments