Skip to content

Commit dfeeb6b

Browse files
authored
chore: automatically the modified changelog to the commit (#12897)
1 parent 1b33533 commit dfeeb6b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/generate_bom.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'bom_analysis.dart';
1313

1414
const packagesDir = 'packages';
1515
const versionsFile = 'VERSIONS.md';
16+
const changelogFile = 'CHANGELOG.md';
1617
const versionsJsonFile = 'scripts/versions.json';
1718
const androidVersionFile =
1819
'$packagesDir/firebase_core/firebase_core/android/gradle.properties';
@@ -108,7 +109,10 @@ void main(List<String> arguments) async {
108109
await addLinkInChangelog(version, date);
109110

110111
// Commit the files and create an annotated tag and a commit
111-
Process.runSync('git', ['add', versionsFile, versionsJsonFile]);
112+
Process.runSync(
113+
'git',
114+
['add', versionsFile, versionsJsonFile, changelogFile],
115+
);
112116
Process.runSync(
113117
'git',
114118
['tag', '-a', 'BoM-v$version', '-m', 'BoM Version $version'],
@@ -226,11 +230,8 @@ Future<void> addLinkInChangelog(String version, String date) async {
226230
.replaceAll('-', r'\-')
227231
.replaceAll('.', r'\.');
228232

229-
// Works only if runned using `melos run bom`
230-
String filePath = 'CHANGELOG.md';
231-
232233
String command =
233-
'sed -i "" "s|$escapedOriginalLine|$escapedNewLine|" $filePath';
234+
'sed -i "" "s|$escapedOriginalLine|$escapedNewLine|" $changelogFile';
234235

235236
ProcessResult result = await Process.run('bash', ['-c', command]);
236237

0 commit comments

Comments
 (0)