add template deleted notice to template linting (#46347)

add template deleted notice

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
This commit is contained in:
Ron Rennick 2024-04-10 17:35:12 -03:00 committed by GitHub
parent d94ed1a843
commit b308132799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -37,6 +37,7 @@ export const scanForTemplateChanges = async (
) }).*`;
const versionRegex = new RegExp( matchVersion, 'g' );
const deletedRegex = new RegExp( '^deleted file mode [0-9]+' );
for ( const p in patches ) {
const patch = patches[ p ];
@ -51,9 +52,16 @@ export const scanForTemplateChanges = async (
for ( const l in lines ) {
const line = lines[ l ];
if ( line.match( deletedRegex ) ) {
code = 'notice';
message = 'Template deleted';
break;
}
if ( line.match( versionRegex ) ) {
code = 'notice';
message = 'Version bump found';
break;
}
if ( repositoryPath ) {