Fetch GitHub MetaData #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch GitHub MetaData | |
on: | |
schedule: | |
# Runs at 00:00 UTC every day | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
fetch-data: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Set up Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: '21' # Adjust to the appropriate Node.js version | |
- name: Install Dependencies | |
run: | | |
npm install cheerio lodash @octokit/rest | |
- name: Fetch GitHub Repos | |
env: | |
GITHUB_TOKEN: ${{ secrets.GHTOKEN }} | |
run: | | |
node ./action/dist/fetch-data.js | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add ghmeta.json | |
git commit -m 'github meta updated' | |
git push |