Skip to content

Commit

Permalink
Update logic to find changes swagger files in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
vishrutshah committed May 18, 2017
1 parent 754adcc commit 3900abb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4757,4 +4757,4 @@
"description": "Client API version."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -705,4 +705,4 @@
"description": "Client Api Version."
}
}
}
}
11 changes: 10 additions & 1 deletion test/util/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ exports.getFilesChangedInPR = function getFilesChangedInPR() {
console.log('>>>>> Files changed in this PR are as follows:')
console.log(filesChanged);
swaggerFilesInPR = filesChanged.split('\n').filter(function (item) {
return (item.match(/.*\/swagger\/*/ig) !== null);
if (item.match(/.*json$/ig) == null) {
return false;
}
if (item.match(/.*\/examples\/*/ig) !== null) {
return false;
}
if (item.match(/.*\/quickstart-templates\/*/ig) !== null) {
return false;
}
return true;
});
console.log(`>>>> Number of swaggers found in this PR: ${swaggerFilesInPR.length}`);

Expand Down

0 comments on commit 3900abb

Please sign in to comment.