diff --git a/.github/scripts/badge-automation.js b/.github/scripts/badge-automation.js index 4f4e3a65..6532ffcd 100644 --- a/.github/scripts/badge-automation.js +++ b/.github/scripts/badge-automation.js @@ -77,9 +77,9 @@ async function sendEmail(email, message, badgeInfo) { async function getUserEmail(username) { try { const { data: user } = await octokit.users.getByUsername({ username }); - return user.email || null; + return user.email; } catch (error) { - console.error(`Error fetching email for ${username}:`, error.message); + console.error(`Error fetching email for ${username}:`, error); return null; } } diff --git a/.github/workflows/badge-automation.yml b/.github/workflows/badge-automation.yml index 39cfea42..0cbecd24 100644 --- a/.github/workflows/badge-automation.yml +++ b/.github/workflows/badge-automation.yml @@ -18,11 +18,12 @@ jobs: node-version: "16.x" - name: Install dependencies - run: npm install @octokit/rest nodemailer + run: npm install @octokdit/rest nodemailer - name: Run badge automation script env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} EMAIL_USER: ${{ secrets.EMAIL_USER }} EMAIL_PASS: ${{ secrets.EMAIL_PASS }} - run: node .github/scripts/badge-automation.js + run: | + node .github/scripts/badge-automation.js