Skip to content

Commit

Permalink
fix mapping to string of number value
Browse files Browse the repository at this point in the history
  • Loading branch information
chicco785 committed May 3, 2023
1 parent 4da4b3f commit aa0c892
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/pullRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,16 @@ export function compare(a: PullRequestInfo, b: PullRequestInfo, sort: Sort): num
* Helper function to retrieve a property from the PullRequestInfo
*/
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) {
core.warning(`⚠️ the provided property '${property}' for \`${useCase}\` is not valid. Fallback to 'body'`)
value = pr['body']
} else if (value instanceof Set) {
value = Array.from(value).join(',') // join into single string
} else if (Array.isArray(value)) {
value = value.join(',') // join into single string
} else {
value = value.toString()
}
return value
}
Expand Down

0 comments on commit aa0c892

Please sign in to comment.