data-robot #669
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: data-robot | |
on: | |
workflow_dispatch: | |
schedule: | |
# Beijing Time 20:00, daily, reference https://crontab.guru/ and https://datetime360.com/cn/utc-beijing-time/ | |
- cron: "0 12 * * *" | |
jobs: | |
data-robot: | |
name: data-robot | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v1 | |
- name: "Setup Node" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: "main" | |
env: | |
EXAMPLE: ${{ secrets.EXAMPLE }} | |
run: npm i --silent && npm run start | |
- name: "Update repo data" | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git checkout $BRANCH_NAME | |
git remote set-url origin https://[email protected]/xianshenglu/github-release-history/ | |
git fetch && git merge && git add . | |
git diff --quiet && git diff --staged --quiet || (git commit -m "ci: add release data" && git push) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PAT_BOT_RELEASE: ${{ secrets.PAT_BOT_RELEASE }} | |
BRANCH_NAME: ${{github.ref_name}} | |