- introduce branch (head ref) as data point in the PullRequestInfo object
- expand extractor to allow using the `branch` -> e.g. to extract the label
This commit is contained in:
+12
-4
@@ -462,12 +462,18 @@ function extractValues(
|
||||
|
||||
if (extractor.onProperty !== undefined) {
|
||||
let results: string[] = []
|
||||
const list: ('title' | 'author' | 'milestone' | 'body' | 'status')[] =
|
||||
extractor.onProperty
|
||||
const list: (
|
||||
| 'title'
|
||||
| 'author'
|
||||
| 'milestone'
|
||||
| 'body'
|
||||
| 'status'
|
||||
| 'branch'
|
||||
)[] = extractor.onProperty
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const prop = list[i]
|
||||
let value: string = pr[prop]
|
||||
let value: string | undefined = pr[prop]
|
||||
if (value === undefined) {
|
||||
core.warning(
|
||||
`⚠️ the provided property '${extractor.onProperty}' for \`${extractor_usecase}\` is not valid`
|
||||
@@ -514,7 +520,9 @@ function extractValuesFromString(
|
||||
export interface RegexTransformer {
|
||||
pattern: RegExp | null
|
||||
target: string
|
||||
onProperty?: ('title' | 'author' | 'milestone' | 'body')[] | undefined
|
||||
onProperty?:
|
||||
| ('title' | 'author' | 'milestone' | 'body' | 'status' | 'branch')[]
|
||||
| undefined
|
||||
method?: 'replace' | 'match' | undefined
|
||||
onEmpty?: string | undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user