fix: overwriting yaml filter patterns (#2307)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
27843f1667
commit
c3a1bb2c99
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
38
src/utils.ts
38
src/utils.ts
@ -1258,16 +1258,11 @@ export const getYamlFilePatterns = async ({
|
||||
const newFilePatterns = await getYamlFilePatternsFromContents({filePath})
|
||||
for (const key in newFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newFilePatterns[key]}.`
|
||||
)
|
||||
filePatterns[key] = [...filePatterns[key], ...newFilePatterns[key]]
|
||||
} else {
|
||||
filePatterns[key] = newFilePatterns[key]
|
||||
}
|
||||
}
|
||||
|
||||
filePatterns = {
|
||||
...filePatterns,
|
||||
...newFilePatterns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1279,15 +1274,14 @@ export const getYamlFilePatterns = async ({
|
||||
|
||||
for (const key in newIgnoreFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_ignore_yaml: Duplicated key ${key} detected, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
||||
)
|
||||
filePatterns[key] = [
|
||||
...filePatterns[key],
|
||||
...newIgnoreFilePatterns[key]
|
||||
]
|
||||
} else {
|
||||
filePatterns[key] = newIgnoreFilePatterns[key]
|
||||
}
|
||||
}
|
||||
filePatterns = {
|
||||
...filePatterns,
|
||||
...newIgnoreFilePatterns
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.filesIgnoreYamlFromSourceFile) {
|
||||
@ -1309,16 +1303,14 @@ export const getYamlFilePatterns = async ({
|
||||
|
||||
for (const key in newIgnoreFilePatterns) {
|
||||
if (key in filePatterns) {
|
||||
core.warning(
|
||||
`files_ignore_yaml_from_source_file: Duplicated key ${key} detected in ${filePath}, the ${filePatterns[key]} will be overwritten by ${newIgnoreFilePatterns[key]}.`
|
||||
)
|
||||
filePatterns[key] = [
|
||||
...filePatterns[key],
|
||||
...newIgnoreFilePatterns[key]
|
||||
]
|
||||
} else {
|
||||
filePatterns[key] = newIgnoreFilePatterns[key]
|
||||
}
|
||||
}
|
||||
|
||||
filePatterns = {
|
||||
...filePatterns,
|
||||
...newIgnoreFilePatterns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user