npm package diff
Package: @forge/manifest
Versions: 7.9.0-next.9 - 7.9.0-next.10
File: package/out/validators/modules-validators/jira/validate-trigger.js
Index: package/out/validators/modules-validators/jira/validate-trigger.js
===================================================================
--- package/out/validators/modules-validators/jira/validate-trigger.js
+++ package/out/validators/modules-validators/jira/validate-trigger.js
@@ -5,19 +5,35 @@
const utils_1 = require("../../../utils");
function validateJiraTriggers(modules, yamlContentByLine) {
const validationErrors = [];
modules?.trigger?.forEach((module) => {
- if (module.filter) {
+ let isIgnoreSelfErrorAdded = false;
+ if (module?.filter?.ignoreSelf) {
const onlyJiraEvents = module.events.every((e) => e.includes('jira'));
- if (!onlyJiraEvents) {
+ if (!onlyJiraEvents && !isIgnoreSelfErrorAdded) {
+ isIgnoreSelfErrorAdded = true;
validationErrors.push({
- message: text_1.errors.modules.trigger.filteringWorksOnlyWithJiraEvents(),
+ message: text_1.errors.modules.trigger.ignoreSelfFilteringWorksOnlyWithJiraEvents(),
reference: text_1.References.Modules,
level: 'error',
...(0, utils_1.findPosition)(module.key, yamlContentByLine)
});
}
}
+ module.events.forEach((event) => {
+ if (typeof event === 'object' && event?.filter?.ignoreSelf) {
+ const isJiraEvent = event.eventType.includes('jira');
+ if (!isJiraEvent && !isIgnoreSelfErrorAdded) {
+ isIgnoreSelfErrorAdded = true;
+ validationErrors.push({
+ message: text_1.errors.modules.trigger.ignoreSelfFilteringWorksOnlyWithJiraEvents(),
+ reference: text_1.References.Modules,
+ level: 'error',
+ ...(0, utils_1.findPosition)(module.key, yamlContentByLine)
+ });
+ }
+ }
+ });
});
return validationErrors;
}
exports.validateJiraTriggers = validateJiraTriggers;