Skip to content

Commit

Permalink
raise warning when using params that are invalid with non automate pr…
Browse files Browse the repository at this point in the history
…ojects
  • Loading branch information
itsjwala committed Sep 11, 2023
1 parent 5a1251e commit d735eae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/config/src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ const ajv = new AJV({
getDefaultSchema()
],
keywords: [{
keyword: 'onlyAutomate',
error: {
message: 'Only valid for Automate type projects'
},
code: cxt => {
let isAutomateProjectToken = (process.env.PERCY_TOKEN || '').split('_')[0] === 'auto';
if (!isAutomateProjectToken) {
cxt.error();
}
}
}, {
// custom instanceof schema validation
keyword: 'instanceof',
metaSchema: {
Expand Down

0 comments on commit d735eae

Please sign in to comment.