Skip to content

Commit

Permalink
fix: simplify patch-release-notes-overview
Browse files Browse the repository at this point in the history
  • Loading branch information
DaRaFF committed Feb 22, 2023
1 parent e98aab8 commit 21366ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = async ({token, owner, repo, sha, tag, test = false} = {}) => {

const patchedBase64ReleaseNotes = Buffer.from(patchedReleaseNotes).toString('base64')

const {patchedBase64ReleaseNotesOverview, releaseNotesOverviewSha, releaseNotesOverviewHtml} = await patchReleaseNotesOverview({token, owner, repo, sha, tag, test, release})
const {patchedBase64ReleaseNotesOverview, releaseNotesOverviewSha, releaseNotesOverviewHtml} = await patchReleaseNotesOverview({token, repo, tag, release})

if (test) return `TEST MODE: do not commit changes`

Expand Down
6 changes: 3 additions & 3 deletions patch-release-notes-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const getReleaseNote = require('./lib/get-release-note')
const targetOwner = 'livingdocsIO'
const targetRepo = 'documentation'

module.exports = async ({token, owner, repo, sha, tag, test = false, release} = {}) => {
module.exports = async ({token, repo, tag, release} = {}) => {
const path = `data/releases.json`
const releaseNote = await getReleaseNote({owner: targetOwner, repo: targetRepo, path, token})

Expand All @@ -13,11 +13,11 @@ module.exports = async ({token, owner, repo, sha, tag, test = false, release} =

if (repo === 'livingdocs-editor') {
patchedContent[release.branchName].editorVersion = tag
console.log(`\n\nUpdate Release Notes overview: Set '${release.branchName}.editorVersion' to ${tag}\n\n`)
console.log(`\n\nUpdate Release Notes overview: Set '${release.branchName}#editorVersion' to ${tag}\n\n`)
}
if (repo === 'livingdocs-server') {
patchedContent[release.branchName].serverVersion = tag
console.log(`\n\nUpdate Release Notes overview: Set '${release.branchName}.serverVersion' to ${tag}\n\n`)
console.log(`\n\nUpdate Release Notes overview: Set '${release.branchName}#serverVersion' to ${tag}\n\n`)
}

const patchedBase64ReleaseNotesOverview = Buffer.from(JSON.stringify(patchedContent, null, 4)).toString('base64')
Expand Down

0 comments on commit 21366ec

Please sign in to comment.