Skip to content

Commit

Permalink
Merge pull request #20 from digdir/remove-filter
Browse files Browse the repository at this point in the history
Remove rewrite rules
  • Loading branch information
bestrand authored Jan 19, 2024
2 parents 4586dc6 + f3f04af commit c1efdd7
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/update-release-notes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,11 @@ jobs:
const templatePath = '${{ github.workspace }}/.github/templates/template.md';
const filePath = '${{ github.workspace }}/content/${{ github.event.client_payload.product }}/release-notes/${{ github.event.client_payload.application-name }}-${{ github.event.client_payload.version }}.md';
const templateFile = fs.readFileSync(templatePath, 'utf8');
const releaseNotesArray = ${{ toJSON(github.event.client_payload.release-notes-array) }};
const replacements = new Map([
["Bump", "Library upgrades"],
]);
const searchesFound = new Set();
const releaseNotesIssues = releaseNotesArray.map(item => {
let issue = `- ${item}`;
for (const [search, replacement] of replacements) {
if (item.startsWith(search)) {
if (!searchesFound.has(search)) {
issue = `- ${replacement}`;
searchesFound.add(search);
} else {
issue = null;
}
break;
}
}
return issue;
}).filter(issue => issue !== null).join('\n');
const fileContent = templateFile
.replace('<title>', '${{ github.event.client_payload.application-name }}-${{ github.event.client_payload.version }}')
.replace('<date>', '${{ github.event.client_payload.date }}')
.replace('<issues>', `\n${releaseNotesIssues}`);
.replace('<issues>', `\n${{ github.event.client_payload.release-notes) }}`);
fs.writeFileSync(filePath, fileContent, 'utf8');
Expand Down

0 comments on commit c1efdd7

Please sign in to comment.