-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2438 from Codeinwp/chore/changelog
refactor: keep only the latest release in the changelog
- Loading branch information
Showing
3 changed files
with
23 additions
and
826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { replaceInFile } from 'replace-in-file'; | ||
|
||
|
||
async function updateChangelog() { | ||
const options = { | ||
files: 'readme.txt', | ||
from: /== Changelog ==[\s\S]*?\[See changelog for all versions\]/, | ||
to: (match) => { | ||
return `== Changelog ==\n\n${process.env.nextReleaseNotes}\n\n[See changelog for all versions]`; | ||
}, | ||
encoding: 'utf8', | ||
}; | ||
try { | ||
const results = await replaceInFile(options); | ||
console.log('Replacement results:', results); | ||
} catch (error) { | ||
console.error('Error occurred:', error); | ||
} | ||
} | ||
|
||
updateChangelog(); |
Oops, something went wrong.