mirror of
https://github.com/actions/labeler.git
synced 2025-12-13 04:57:21 +00:00
Run the build command
This commit is contained in:
28
dist/index.js
vendored
28
dist/index.js
vendored
@@ -170,7 +170,8 @@ function toChangedFilesMatchConfig(config) {
|
|||||||
changedFiles: {}
|
changedFiles: {}
|
||||||
};
|
};
|
||||||
if (Array.isArray(changedFilesConfig)) {
|
if (Array.isArray(changedFilesConfig)) {
|
||||||
if (changedFilesConfig.every(entry => typeof entry === 'string')) {
|
if (changedFilesConfig.length &&
|
||||||
|
changedFilesConfig.every(entry => typeof entry === 'string')) {
|
||||||
changedFilesMatchConfig.changedFiles = {
|
changedFilesMatchConfig.changedFiles = {
|
||||||
any: changedFilesConfig
|
any: changedFilesConfig
|
||||||
};
|
};
|
||||||
@@ -178,15 +179,23 @@ function toChangedFilesMatchConfig(config) {
|
|||||||
else {
|
else {
|
||||||
// If it is not an array of strings then it should be array of further config options
|
// If it is not an array of strings then it should be array of further config options
|
||||||
// so assign them to our `changedFilesMatchConfig`
|
// so assign them to our `changedFilesMatchConfig`
|
||||||
Object.assign(changedFilesMatchConfig.changedFiles, ...changedFilesConfig);
|
changedFilesMatchConfig.changedFiles = changedFilesConfig.reduce((updatedMatchConfig, configValue) => {
|
||||||
Object.keys(changedFilesMatchConfig.changedFiles).forEach(key => {
|
if (!configValue) {
|
||||||
const value = changedFilesMatchConfig.changedFiles[key];
|
return updatedMatchConfig;
|
||||||
changedFilesMatchConfig.changedFiles[key] = Array.isArray(value)
|
}
|
||||||
? value
|
Object.entries(configValue).forEach(([key, value]) => {
|
||||||
: [value];
|
if (key === 'any' || key === 'all') {
|
||||||
});
|
updatedMatchConfig[key] = Array.isArray(value) ? value : [value];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return updatedMatchConfig;
|
||||||
|
}, {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If no items were added to `changedFiles` then return an empty object
|
||||||
|
if (!Object.keys(changedFilesMatchConfig.changedFiles).length) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
return changedFilesMatchConfig;
|
return changedFilesMatchConfig;
|
||||||
}
|
}
|
||||||
exports.toChangedFilesMatchConfig = toChangedFilesMatchConfig;
|
exports.toChangedFilesMatchConfig = toChangedFilesMatchConfig;
|
||||||
@@ -384,6 +393,9 @@ function checkMatchConfigs(changedFiles, matchConfigs) {
|
|||||||
exports.checkMatchConfigs = checkMatchConfigs;
|
exports.checkMatchConfigs = checkMatchConfigs;
|
||||||
function checkMatch(changedFiles, matchConfig) {
|
function checkMatch(changedFiles, matchConfig) {
|
||||||
var _a, _b;
|
var _a, _b;
|
||||||
|
if (!Object.keys(matchConfig).length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ((_a = matchConfig.changedFiles) === null || _a === void 0 ? void 0 : _a.all) {
|
if ((_a = matchConfig.changedFiles) === null || _a === void 0 ? void 0 : _a.all) {
|
||||||
if (!(0, changedFiles_1.checkAll)(changedFiles, matchConfig.changedFiles.all)) {
|
if (!(0, changedFiles_1.checkAll)(changedFiles, matchConfig.changedFiles.all)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user