Skip to content

Commit

Permalink
Merge pull request #475 from adarsh-jha-dev/390-Automate-Badge-Distri…
Browse files Browse the repository at this point in the history
…bution-Based-on-Merged-PR-Activity-bug-fix

typo in yml file
  • Loading branch information
phyleria authored Nov 28, 2024
2 parents 8db3f55 + 5d1b69f commit d9ffd4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/badge-automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
return user.email || null;
} catch (error) {
console.error(`Error fetching email for ${username}:`, error);
console.error(`Error fetching email for ${username}:`, error.message);
return null;
}
}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/badge-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
node-version: "16.x"

- name: Install dependencies
run: npm install @octokdit/rest nodemailer
run: npm install @octokit/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

0 comments on commit d9ffd4d

Please sign in to comment.