Skip to content

Commit

Permalink
Merge pull request #3 from RegestaItalia/keywordsParsing
Browse files Browse the repository at this point in the history
keywords parsing
  • Loading branch information
simonegaffurini authored Jun 22, 2024
2 parents c2e2516 + cdf2fdc commit 1abc706
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions dist/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ const _getSapEntries = (iSapEntries) => {
});
return sapEntries;
};
const _getKeywords = (iKeywords) => {
if (!iKeywords) {
return [];
}
var keywords;
try {
keywords = JSON.parse(iKeywords);
}
catch (e) {
keywords = iKeywords.split(',');
}
return keywords;
};
function publish(data) {
return __awaiter(this, void 0, void 0, function* () {
const debug = core.isDebug();
Expand All @@ -158,15 +171,15 @@ function publish(data) {
const packageName = data.packageName;
const packageVersion = data.packageVersion;
const packagePrivate = data.private;
const authors = data.authors;
const backwardsCompatible = data.backwardsCompatible;
const devclass = data.devclass;
const target = data.target;
const releaseTimeout = data.releaseTimeout;
const description = data.description;
const git = data.git;
const license = data.license;
const keywords = data.keywords;
const keywords = _getKeywords(data.keywords);
const authors = data.authors;
const website = data.website;
const readme = _getReadme(data.readme);
const overwriteManifestValues = data.overwriteManifestValues;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trm-action-publish",
"version": "2.1.0",
"version": "2.1.1",
"description": "Github Action - TRM Publish",
"scripts": {
"build": "tsc",
Expand Down
17 changes: 15 additions & 2 deletions src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ const _getSapEntries = (iSapEntries: string): any => {
return sapEntries;
}

const _getKeywords = (iKeywords: string): string[] => {
if(!iKeywords){
return [];
}
var keywords;
try{
keywords = JSON.parse(iKeywords);
}catch(e){
keywords = iKeywords.split(',');
}
return keywords;
}

export async function publish(data: ActionArgs) {
const debug = core.isDebug();
if(data.simpleLog){
Expand Down Expand Up @@ -161,15 +174,15 @@ export async function publish(data: ActionArgs) {
const packageName = data.packageName;
const packageVersion = data.packageVersion;
const packagePrivate = data.private;
const authors = data.authors;
const backwardsCompatible = data.backwardsCompatible;
const devclass = data.devclass;
const target = data.target;
const releaseTimeout = data.releaseTimeout;
const description = data.description;
const git = data.git;
const license = data.license;
const keywords = data.keywords;
const keywords = _getKeywords(data.keywords);
const authors = data.authors;
const website = data.website;
const readme = _getReadme(data.readme);
const overwriteManifestValues = data.overwriteManifestValues;
Expand Down

0 comments on commit 1abc706

Please sign in to comment.