fix mapping to string of number value
This commit is contained in:
+3
@@ -728,6 +728,9 @@ function retrieveProperty(pr, property, useCase) {
|
|||||||
else if (Array.isArray(value)) {
|
else if (Array.isArray(value)) {
|
||||||
value = value.join(','); // join into single string
|
value = value.join(','); // join into single string
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
value = value.toString();
|
||||||
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
exports.retrieveProperty = retrieveProperty;
|
exports.retrieveProperty = retrieveProperty;
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-1
@@ -212,7 +212,7 @@ export function compare(a: PullRequestInfo, b: PullRequestInfo, sort: Sort): num
|
|||||||
* Helper function to retrieve a property from the PullRequestInfo
|
* Helper function to retrieve a property from the PullRequestInfo
|
||||||
*/
|
*/
|
||||||
export function retrieveProperty(pr: PullRequestInfo, property: Property, useCase: string): string {
|
export function retrieveProperty(pr: PullRequestInfo, property: Property, useCase: string): string {
|
||||||
let value: string | Set<string> | string[] | undefined = pr[property]
|
let value: string | number | Set<string> | string[] | undefined = pr[property]
|
||||||
if (value === undefined) {
|
if (value === undefined) {
|
||||||
core.warning(`⚠️ the provided property '${property}' for \`${useCase}\` is not valid. Fallback to 'body'`)
|
core.warning(`⚠️ the provided property '${property}' for \`${useCase}\` is not valid. Fallback to 'body'`)
|
||||||
value = pr['body']
|
value = pr['body']
|
||||||
@@ -220,6 +220,8 @@ export function retrieveProperty(pr: PullRequestInfo, property: Property, useCas
|
|||||||
value = Array.from(value).join(',') // join into single string
|
value = Array.from(value).join(',') // join into single string
|
||||||
} else if (Array.isArray(value)) {
|
} else if (Array.isArray(value)) {
|
||||||
value = value.join(',') // join into single string
|
value = value.join(',') // join into single string
|
||||||
|
} else {
|
||||||
|
value = value.toString()
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user