chore(actions): clean logging

This commit is contained in:
Jan De Dobbeleer 2022-10-21 09:00:06 +02:00 committed by Jan De Dobbeleer
parent 6cc309d00b
commit 7bc50de8ec

View file

@ -18,7 +18,8 @@ jobs:
const pr = context.payload; const pr = context.payload;
console.log(`Repo: ${repo}`); console.log(`Repo: ${repo}`);
console.log(`Pull Request: ${pr}`); console.log(`Owner: ${owner}`);
console.log(`Pull Request: ${JSON.stringify(pr)}`);
const response = await github.rest.pulls.listFiles({ const response = await github.rest.pulls.listFiles({
owner, repo, owner, repo,
@ -32,15 +33,17 @@ jobs:
let hasThemeAdditions = false; let hasThemeAdditions = false;
for (const file in response.data) { for (const file in response.data) {
console.log(`File: ${file}`); const name = file.filename
if (file.status === 'added' && file.filename.includes('themes/')) { console.log(`File: ${name}`);
console.log(`File: ${file.filename} is a theme addition`); if (file.status === 'added' && name.includes('themes/')) {
console.log(`File: ${name} is a theme addition`);
hasThemeAdditions = true; hasThemeAdditions = true;
break; break;
} }
} }
if (!hasThemeAdditions) { if (!hasThemeAdditions) {
console.log('No theme additions found.');
return; return;
} }