From 44e925787b5a6b842abf13454a1904b458690656 Mon Sep 17 00:00:00 2001 From: Panto! Date: Tue, 2 Jan 2024 07:23:22 -0300 Subject: [PATCH] feat: commits inside a nested property This is in case we want to add more stuff to changelogs --- methods/GenerateNightlyChangelog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/methods/GenerateNightlyChangelog.js b/methods/GenerateNightlyChangelog.js index 8b4efa6..12ebf2f 100644 --- a/methods/GenerateNightlyChangelog.js +++ b/methods/GenerateNightlyChangelog.js @@ -17,8 +17,7 @@ const currentTimestamp = releases[0]?.publishedAt; const previousTimestamp = releases[1]?.publishedAt; const commits = await GetCommits("YARC-Official", "YARG", "dev", previousTimestamp, currentTimestamp); - -const formatted = commits.map(commit => { +const formattedCommits = commits.map(commit => { return { sha: commit.oid, author: commit.author.user.login, @@ -26,5 +25,9 @@ const formatted = commits.map(commit => { } }); +const output = { + commits: formattedCommits +}; + const savePath = path.join(NIGHTLYYARG_CHANGELOG_FOLDER, currentTag); -await fs.writeFile(savePath, JSON.stringify(formatted, null, 2)); +await fs.writeFile(savePath, JSON.stringify(output, null, 2));