Fetch GitHub Trending #24
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 Trending | |
on: | |
# push: | |
# branches: | |
# - main | |
schedule: | |
- cron: '* 1 * * *' # UTC 凌晨一点 | |
- cron: '* 17 * * *' # UTC+8 凌晨一点 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
# - name: Build the languages | |
# run: pnpm gen:lang | |
- name: Build the trending | |
run: pnpm build | |
- name: Commit and Push changes | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m ":rocket: Fetch GitHub Trending at $(date +'%Y-%m-%d %H:%M')" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |