-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (41 loc) · 1.32 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: auto update
on:
push:
branches: ['main']
schedule:
- cron: '0 * * * *'
jobs:
generate:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: install dependence
run: npm i -g pnpm && pnpm i --no-frozen-lockfile
- name: generate RSS and push notifacations
run: npm run rss
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
DING_TALK_BOT_TOKEN: ${{ secrets.DING_TALK_BOT_TOKEN }}
- name: update README
run: npx jtm run --watch false
- name: commit the all info
id: commit_msg
run: |
if git status -s | grep -q .; then
echo "Changes detected, committing..."
git status -s
echo "check_result=success" >> $GITHUB_OUTPUT
else
echo "No changes to commit"
exit 0
fi
git config --global user.email "eyelly.wu@gmail.com"
git config --global user.name "GitHub Workflow"
git add .
git commit -m 'chore: automatic update of GitHub workflow'
- name: git push
if: steps.commit_msg.outputs.check_result == 'success'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUBLISH_TOKEN }}