You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/validate-plugin-entry.yml
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -105,55 +105,55 @@ jobs:
105
105
addError(`It seems like you made a typo in the repository field \`${plugin.repo}\`.`);
106
106
}
107
107
108
-
if (plugin.id.toLowerCase().includes('obsidian')) {
108
+
if (plugin.id?.toLowerCase().includes('obsidian')) {
109
109
addError(`Please don't use the word \`obsidian\` in the plugin ID. The ID is used for your plugin's folder so keeping it short and simple avoids clutter and helps with sorting.`);
110
110
}
111
-
if (plugin.id.toLowerCase().endsWith('plugin')) {
111
+
if (plugin.id?.toLowerCase().endsWith('plugin')) {
112
112
addError(`Please don't use the word \`plugin\` in the plugin ID. The ID is used for your plugin's folder so keeping it short and simple avoids clutter and helps with sorting.`);
113
113
}
114
-
if (!/^[a-z0-9-_]+$/.test(plugin.id)) {
114
+
if (plugin.id && !/^[a-z0-9-_]+$/.test(plugin.id)) {
115
115
addError('The plugin ID is not valid. Only alphanumeric lowercase characters and dashes are allowed.');
116
116
}
117
117
118
-
else if (plugin.name.toLowerCase().includes('obsidian')) {
118
+
else if (plugin.name?.toLowerCase().includes('obsidian')) {
119
119
addError(`Please don't use the word \`Obsidian\` in your plugin name since it's redundant and adds clutter to the plugin list.`);
120
120
}
121
-
if (plugin.name.toLowerCase().endsWith('plugin')) {
121
+
if (plugin.name?.toLowerCase().endsWith('plugin')) {
122
122
addError(`Please don't use the word \`Plugin\` in the plugin name since it's redundant and adds clutter to the plugin list.`);
123
123
}
124
124
125
-
if (/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(plugin.author)) {
125
+
if (plugin.author && /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/.test(plugin.author)) {
126
126
addWarning(`We generally discourage including your email addresses in the \`author\` field.`);
127
127
}
128
128
129
-
if (plugin.description.toLowerCase().includes('obsidian')) {
129
+
if (plugin.description?.toLowerCase().includes('obsidian')) {
130
130
addError('Please don\'t include `Obsidian` in the plugin description');
131
131
}
132
-
if (plugin.description.toLowerCase().includes('this plugin') || plugin.description.toLowerCase().includes('this is a plugin') || plugin.description.toLowerCase().includes('this plugin allows')) {
132
+
if (plugin.description?.toLowerCase().includes('this plugin') || plugin.description?.toLowerCase().includes('this is a plugin') || plugin.description?.toLowerCase().includes('this plugin allows')) {
133
133
addWarning('Avoid including sentences like `This is a plugin that does` in your description');
134
134
}
135
135
136
-
if (plugin.description.length > 250) {
136
+
if (plugin.description?.length > 250) {
137
137
addError(`Your plugin has a long description. Users typically find it difficult to read a very long description, so you should keep it short and concise.`);
138
138
}
139
139
140
-
if (plugins.filter(p => p.id === plugin.id).length > 1) {
addError(`Another plugin used to exist with the id \`${plugin.id}\`. To avoid issues for users that still have the old plugin installed using this plugin ID is not allowed`);
154
154
}
155
155
156
-
if (removedPlugins.filter(p => p.name === plugin.name).length > 1) {
addWarning(`Another plugin used to exist with the name \`${plugin.name}\`. To avoid confussion we recommend against using this name.`);
158
158
}
159
159
@@ -178,10 +178,10 @@ jobs:
178
178
}
179
179
}
180
180
181
-
if (manifest.id !== plugin.id) {
181
+
if (plugin.name && manifest.id !== plugin.id) {
182
182
addError(`Plugin ID mismatch, the ID in this PR (\`${plugin.id}\`) is not the same as the one in your repo (\`${manifest.id}\`). If you just changed your plugin ID, remember to change it in the manifest.json in your repo and your latest GitHub release.`);
183
183
}
184
-
if (manifest.name !== plugin.name) {
184
+
if (plugin.name && manifest.name !== plugin.name) {
185
185
addError(`Plugin name mismatch, the name in this PR (\`${plugin.name}\`) is not the same as the one in your repo (\`${manifest.name}\`). If you just changed your plugin name, remember to change it in the manifest.json in your repo and your latest GitHub release.`);
0 commit comments