Skip to content

Commit 6cf7a93

Browse files
author
Travis Sheppard
authored
chore: enable dependabot (#1568)
1 parent 2256175 commit 6cf7a93

File tree

2 files changed

+248
-0
lines changed

2 files changed

+248
-0
lines changed

.github/dependabot.yaml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# This file is automatically generated by running `dart tool/update_dependabot_config.dart`
2+
# Do not edit manually.
3+
version: 2
4+
enable-beta-ecosystems: true
5+
updates:
6+
- package-ecosystem: "pub"
7+
directory: "example/"
8+
schedule:
9+
interval: "daily"
10+
- package-ecosystem: "pub"
11+
directory: "packages/amplify/amplify_flutter/"
12+
schedule:
13+
interval: "daily"
14+
- package-ecosystem: "pub"
15+
directory: "packages/amplify/amplify_flutter/example/"
16+
schedule:
17+
interval: "daily"
18+
- package-ecosystem: "pub"
19+
directory: "packages/amplify/amplify_flutter_android/"
20+
schedule:
21+
interval: "daily"
22+
- package-ecosystem: "pub"
23+
directory: "packages/amplify/amplify_flutter_android/example/"
24+
schedule:
25+
interval: "daily"
26+
- package-ecosystem: "pub"
27+
directory: "packages/amplify/amplify_flutter_ios/"
28+
schedule:
29+
interval: "daily"
30+
- package-ecosystem: "pub"
31+
directory: "packages/amplify/amplify_flutter_ios/example/"
32+
schedule:
33+
interval: "daily"
34+
- package-ecosystem: "pub"
35+
directory: "packages/amplify_authenticator/"
36+
schedule:
37+
interval: "daily"
38+
- package-ecosystem: "pub"
39+
directory: "packages/amplify_authenticator/example/"
40+
schedule:
41+
interval: "daily"
42+
- package-ecosystem: "pub"
43+
directory: "packages/amplify_authenticator/example/.dart_tool/flutter_gen/"
44+
schedule:
45+
interval: "daily"
46+
- package-ecosystem: "pub"
47+
directory: "packages/amplify_core/"
48+
schedule:
49+
interval: "daily"
50+
- package-ecosystem: "pub"
51+
directory: "packages/amplify_core/example/"
52+
schedule:
53+
interval: "daily"
54+
- package-ecosystem: "pub"
55+
directory: "packages/amplify_datastore/"
56+
schedule:
57+
interval: "daily"
58+
- package-ecosystem: "pub"
59+
directory: "packages/amplify_datastore/example/"
60+
schedule:
61+
interval: "daily"
62+
- package-ecosystem: "pub"
63+
directory: "packages/amplify_datastore_plugin_interface/"
64+
schedule:
65+
interval: "daily"
66+
- package-ecosystem: "pub"
67+
directory: "packages/amplify_lints/"
68+
schedule:
69+
interval: "daily"
70+
- package-ecosystem: "pub"
71+
directory: "packages/amplify_test/"
72+
schedule:
73+
interval: "daily"
74+
- package-ecosystem: "pub"
75+
directory: "packages/analytics/amplify_analytics_pinpoint/"
76+
schedule:
77+
interval: "daily"
78+
- package-ecosystem: "pub"
79+
directory: "packages/analytics/amplify_analytics_pinpoint/example/"
80+
schedule:
81+
interval: "daily"
82+
- package-ecosystem: "pub"
83+
directory: "packages/analytics/amplify_analytics_pinpoint_android/"
84+
schedule:
85+
interval: "daily"
86+
- package-ecosystem: "pub"
87+
directory: "packages/analytics/amplify_analytics_pinpoint_android/example/"
88+
schedule:
89+
interval: "daily"
90+
- package-ecosystem: "pub"
91+
directory: "packages/analytics/amplify_analytics_pinpoint_ios/"
92+
schedule:
93+
interval: "daily"
94+
- package-ecosystem: "pub"
95+
directory: "packages/analytics/amplify_analytics_pinpoint_ios/example/"
96+
schedule:
97+
interval: "daily"
98+
- package-ecosystem: "pub"
99+
directory: "packages/analytics/amplify_analytics_plugin_interface/"
100+
schedule:
101+
interval: "daily"
102+
- package-ecosystem: "pub"
103+
directory: "packages/api/amplify_api/"
104+
schedule:
105+
interval: "daily"
106+
- package-ecosystem: "pub"
107+
directory: "packages/api/amplify_api/example/"
108+
schedule:
109+
interval: "daily"
110+
- package-ecosystem: "pub"
111+
directory: "packages/api/amplify_api_android/"
112+
schedule:
113+
interval: "daily"
114+
- package-ecosystem: "pub"
115+
directory: "packages/api/amplify_api_android/example/"
116+
schedule:
117+
interval: "daily"
118+
- package-ecosystem: "pub"
119+
directory: "packages/api/amplify_api_ios/"
120+
schedule:
121+
interval: "daily"
122+
- package-ecosystem: "pub"
123+
directory: "packages/api/amplify_api_ios/example/"
124+
schedule:
125+
interval: "daily"
126+
- package-ecosystem: "pub"
127+
directory: "packages/api/amplify_api_plugin_interface/"
128+
schedule:
129+
interval: "daily"
130+
- package-ecosystem: "pub"
131+
directory: "packages/auth/amplify_auth_cognito/"
132+
schedule:
133+
interval: "daily"
134+
- package-ecosystem: "pub"
135+
directory: "packages/auth/amplify_auth_cognito/example/"
136+
schedule:
137+
interval: "daily"
138+
- package-ecosystem: "pub"
139+
directory: "packages/auth/amplify_auth_cognito_android/"
140+
schedule:
141+
interval: "daily"
142+
- package-ecosystem: "pub"
143+
directory: "packages/auth/amplify_auth_cognito_android/example/"
144+
schedule:
145+
interval: "daily"
146+
- package-ecosystem: "pub"
147+
directory: "packages/auth/amplify_auth_cognito_ios/"
148+
schedule:
149+
interval: "daily"
150+
- package-ecosystem: "pub"
151+
directory: "packages/auth/amplify_auth_cognito_ios/example/"
152+
schedule:
153+
interval: "daily"
154+
- package-ecosystem: "pub"
155+
directory: "packages/auth/amplify_auth_plugin_interface/"
156+
schedule:
157+
interval: "daily"
158+
- package-ecosystem: "pub"
159+
directory: "packages/aws_common/"
160+
schedule:
161+
interval: "daily"
162+
- package-ecosystem: "pub"
163+
directory: "packages/aws_signature_v4/"
164+
schedule:
165+
interval: "daily"
166+
- package-ecosystem: "pub"
167+
directory: "packages/aws_signature_v4/example/"
168+
schedule:
169+
interval: "daily"
170+
- package-ecosystem: "pub"
171+
directory: "packages/storage/amplify_storage_plugin_interface/"
172+
schedule:
173+
interval: "daily"
174+
- package-ecosystem: "pub"
175+
directory: "packages/storage/amplify_storage_s3/"
176+
schedule:
177+
interval: "daily"
178+
- package-ecosystem: "pub"
179+
directory: "packages/storage/amplify_storage_s3/example/"
180+
schedule:
181+
interval: "daily"
182+
- package-ecosystem: "pub"
183+
directory: "packages/storage/amplify_storage_s3_android/"
184+
schedule:
185+
interval: "daily"
186+
- package-ecosystem: "pub"
187+
directory: "packages/storage/amplify_storage_s3_ios/"
188+
schedule:
189+
interval: "daily"

tool/update_dependabot_config.dart

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
import 'dart:io';
17+
18+
const pubspecName = 'pubspec.yaml';
19+
const configPath = '.github/dependabot.yaml';
20+
21+
void main() async {
22+
await _updateDependabotConfig();
23+
}
24+
25+
Future<void> _updateDependabotConfig() async {
26+
// Generate a list of paths for all the pubspec.yaml files found recursively.
27+
final dir = Directory('.');
28+
final result = dir.listSync(recursive: true, followLinks: false);
29+
final pubspecPaths = result
30+
.where((element) => element.path.contains(pubspecName))
31+
.map(
32+
(e) => e.path.replaceFirst('./', '').replaceFirst('$pubspecName', ''))
33+
.toList();
34+
pubspecPaths.sort();
35+
print(
36+
'Updating dependabot.yaml with all ${pubspecPaths.length} pubspec.yaml files.');
37+
38+
// Map the paths to all the blocks for the config file.
39+
final configFile = File(configPath);
40+
String fileContents = '''
41+
# This file is automatically generated by running `dart tool/update_dependabot_config.dart`
42+
# Do not edit manually.
43+
version: 2
44+
enable-beta-ecosystems: true
45+
updates:
46+
''';
47+
pubspecPaths.forEach((filePath) {
48+
String block = '''
49+
- package-ecosystem: "pub"
50+
directory: "$filePath"
51+
schedule:
52+
interval: "daily"
53+
''';
54+
fileContents += block;
55+
});
56+
57+
await configFile.writeAsString(fileContents);
58+
print('Done.');
59+
}

0 commit comments

Comments
 (0)