Skip to content

Commit

Permalink
fix: another indentation attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
hexnickk4997 committed Jan 9, 2024
1 parent 07e28fa commit 3fa5c16
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/fetch-audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ jobs:
- name: Create fetcher script
run: |
cat <<EOF > /tmp/fetch-audits.js
const API_URL = 'https://api.github.com/repos/lidofinance/audits/contents/';
const API_URL = 'https://api.github.com/repos/lidofinance/audits/contents/';
async function countPdfFiles(path = '') {
const response = await fetch(API_URL + path);
const data = await response.json();
let count = 0;
async function countPdfFiles(path = '') {
const response = await fetch(API_URL + path);
const data = await response.json();
let count = 0;
for (const item of data) {
if (item.type === 'file' && item.name.endsWith('.pdf')) {
count++;
} else if (item.type === 'dir') {
count += await countPdfFiles(item.path);
}
}
for (const item of data) {
if (item.type === 'file' && item.name.endsWith('.pdf')) {
count++;
} else if (item.type === 'dir') {
count += await countPdfFiles(item.path);
}
}
return count;
}
return count;
}
countPdfFiles().then(count => {
console.log(`count: ${count}`);
});
countPdfFiles().then(count => {
console.log(`count: ${count}`);
});
EOF
EOF
- name: Execute fetcher script
run: node /tmp/fetch-audits.js

0 comments on commit 3fa5c16

Please sign in to comment.