mirror of
https://github.com/localsend/localsend.git
synced 2026-06-23 04:10:07 +00:00
chore: add contributions script
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import 'dart:io';
|
||||
|
||||
/// Used to make the changes in the Github Releases shorter.
|
||||
/// Aggregates documentation and i18n PRs to "i18n: @user1, @user2".
|
||||
/// Keeps other contributions (PRs) as is.
|
||||
void main() {
|
||||
final contributions = File('contributions.txt').readAsLinesSync();
|
||||
final newContributions = <String>[];
|
||||
final documentations = <String>{}; // list of "@user"
|
||||
final translators = <String>{}; // list of "@user"
|
||||
for (String pr in contributions) {
|
||||
pr = pr.toLowerCase();
|
||||
if (pr.contains('@dependabot')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pr.contains('i18n') || pr.contains('translation') || pr.contains('translator') || pr.contains('language')) {
|
||||
translators.add('@' + pr.split(' @').last);
|
||||
} else if (pr.contains('readme') || pr.contains('contributing')) {
|
||||
documentations.add('@' + pr.split(' @').last);
|
||||
} else {
|
||||
newContributions.add(pr);
|
||||
}
|
||||
}
|
||||
|
||||
final content = newContributions.join('\n') + '\n' + '* docs: ${documentations.join(', ')}' + '\n' + '* i18n: ${translators.join(', ')}';
|
||||
print('Content: $content');
|
||||
|
||||
File('contributions_digested.txt').writeAsStringSync(content);
|
||||
print('Finish!');
|
||||
}
|
||||
Reference in New Issue
Block a user