Skip to content

Commit

Permalink
fix(package): update auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie-BitFlight committed Sep 27, 2023
2 parents 32a6a5c + a1a2489 commit d91f911
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"*.{ts,js,json,md}": [
"prettier --write"
]
"*.{ts,js,json,md}": ["prettier --write"]
}
Binary file added .yarn/install-state.gz
Binary file not shown.
Empty file added .yarn/versions/ae0aa77e.yml
Empty file.
20 changes: 15 additions & 5 deletions dist/index.cjs

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion src/sections/update-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,21 @@ export default async function updateInputs(token: string, inputs: Inputs): Promi
log.start();
for (const key of Object.keys(vars)) {
const values = vars[key];

let description = values?.description ?? '';

// Check if only first line should be added (only subject without body)
// eslint-disable-next-line no-useless-escape
const matches = description.match('(.*?)\n\n([Ss]*)');
if (matches && matches.length >= 2) {
description = matches[1] || description;
}

description = description.trim().replace('\n', '<br />');

const row: string[] = [
rowHeader(key),
values?.description?.trim() ?? '',
description,
values?.default ? `\`${values.default}\`` : '',
values?.required ? '**true**' : '__false__',
];
Expand Down
14 changes: 13 additions & 1 deletion src/sections/update-outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@ export default async function updateOutputs(token: string, inputs: Inputs): Prom
log.start();
for (const key of Object.keys(vars)) {
const values = vars[key];
const row: string[] = [rowHeader(key), values?.description?.trim().replace('\n', ' ') ?? ''];

let description = values?.description ?? '';

// Check if only first line should be added (only subject without body)
// eslint-disable-next-line no-useless-escape
const matches = description.match('(.*?)\n\n([Ss]*)');
if (matches && matches.length >= 2) {
description = matches[1] || description;
}

description = description.trim().replace('\n', '<br />');
const row: string[] = [rowHeader(key), description];

log.debug(JSON.stringify(row));
markdownArray.push(row);
}
Expand Down

0 comments on commit d91f911

Please sign in to comment.