Skip to content

Commit

Permalink
Update websitetoissue.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
blackgirlbytes authored Sep 30, 2024
1 parent bd8f29c commit b1562cd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/websitetoissue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18' # Updated to a more recent version

- name: Install dependencies
run: npm install axios cheerio

- name: Fetch website data and update GitHub issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create update script
run: |
cat << EOF > update_leaderboard.js
const axios = require('axios');
const cheerio = require('cheerio');
async function updateLeaderboard() {
try {
// Fetch data from the website
const websiteUrl = 'https://leaderboard-nk9strn08-blackgirlbytes-projects.vercel.app';
const websiteUrl = 'https://leaderboard-nk9strn08-blackgirlbytes-projects.vercel.app';
const { data } = await axios.get(websiteUrl);
const $ = cheerio.load(data);
Expand Down Expand Up @@ -70,7 +69,14 @@ jobs:
console.log('Leaderboard issue updated successfully!');
} catch (error) {
console.error('Error updating leaderboard:', error.message);
process.exit(1);
}
}
updateLeaderboard();
EOF
- name: Run update script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node update_leaderboard.js

0 comments on commit b1562cd

Please sign in to comment.