-
Notifications
You must be signed in to change notification settings - Fork 6
164 lines (155 loc) · 7.09 KB
/
blog-post-workflow.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Update README with latest blog posts
on:
schedule: # Run workflow automatically
- cron: "15 8-11 */2 * *" # Runs every hour, on the hour
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
push:
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up Git
# run: |
# git config --global user.name "kubbot"
# git config --global user.email "[email protected]"
- name: Pull in dev.to posts
uses: gautamkrishnar/blog-post-workflow@v1
with:
comment_tag_name: "My-Blog-EN"
feed_list: "https://nsddd.top/index.xml"
token: ${{ secrets.BOT_GITHUB_TOKEN }}
max_post_count: 100
commit_message: "🔥docs(main): update with latest RadioGeek feed from EN"
committer_username: "kubbot"
disable_html_encoding: true
update-readme-with-blog-zh:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up Git
# run: |
# git config --global user.name "kubbot"
# git config --global user.email "[email protected]"
- name: Pull in Chinese posts
uses: gautamkrishnar/blog-post-workflow@v1
with:
comment_tag_name: "My-Blog-ZH"
feed_list: "https://nsddd.top/zh/index.xml"
token: ${{ secrets.BOT_GITHUB_TOKEN }}
max_post_count: 100
commit_message: "🔥docs(main): update with latest RadioGeek feed from ZH"
committer_username: "kubbot"
disable_html_encoding: true
# 运行一系列 shell 命令,配置本地 Git 设置,从远程库拉取最新版本并推送到远程库。
- name: Auto green
run: |
git config --local user.email "[email protected]"
git config --local user.name "kubbot"
git remote set-url origin https://${{ secrets.BOT_GITHUB_TOKEN }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull --rebase
# 将 UTC 时间转换为上海时间
local_time=$(date -u -d "$(date -u)" "+%Y-%m-%d %H:%M:%S" -d "8 hours")
# 允许空提交,-a 省略git add . 而且设置签名
git commit --allow-empty -a -s -m "🌟 You never lose, either you win or you learn! 💪"
git push
update-readme-with-blog-es:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up Git
# run: |
# git config --global user.name "kubbot"
# git config --global user.email "[email protected]"
- name: Pull in Spanish posts
uses: gautamkrishnar/blog-post-workflow@v1
with:
comment_tag_name: "My-Blog-ES"
feed_list: "https://nsddd.top/es/index.xml"
token: ${{ secrets.BOT_GITHUB_TOKEN }}
max_post_count: 100
commit_message: "🔥docs(main): update with latest RadioGeek feed from ES"
committer_username: "kubbot"
# disable_html_encoding: true
# 运行一系列 shell 命令,配置本地 Git 设置,从远程库拉取最新版本并推送到远程库。
- name: Auto green
run: |
git config --local user.email "[email protected]"
git config --local user.name "kubbot"
git remote set-url origin https://${{ secrets.BOT_GITHUB_TOKEN }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull --rebase
# 将 UTC 时间转换为上海时间
local_time=$(date -u -d "$(date -u)" "+%Y-%m-%d %H:%M:%S" -d "8 hours")
git commit --allow-empty -a -s -m "🌟 You never lose, either you win or you learn! 💪"
git push
update-readme-with-blog-fr:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up Git
# run: |
# git config --global user.name "kubbot"
# git config --global user.email "[email protected]"
- name: Pull in French posts
uses: gautamkrishnar/blog-post-workflow@v1
with:
comment_tag_name: "My-Blog-FR"
feed_list: "https://nsddd.top/fr/index.xml"
token: ${{ secrets.BOT_GITHUB_TOKEN }}
max_post_count: 100
commit_message: "🔥docs(main): update with latest RadioGeek feed from FR"
committer_username: "kubbot"
# disable_html_encoding: true
# 运行一系列 shell 命令,配置本地 Git 设置,从远程库拉取最新版本并推送到远程库。
- name: Auto green
run: |
git config --local user.email "[email protected]"
git config --local user.name "kubbot"
git remote set-url origin https://${{ secrets.BOT_GITHUB_TOKEN }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull --rebase
# 将 UTC 时间转换为上海时间
local_time=$(date -u -d "$(date -u)" "+%Y-%m-%d %H:%M:%S" -d "8 hours")
# 允许空提交,-a 省略git add . 而且设置签名
git commit --allow-empty -a -s -m "🌟 You never lose, either you win or you learn! 💪"
git push
# https://nsddd.top/zh-tw/index.xml
update-readme-with-blog-zh-tw:
name: Update this repo's README with latest blog posts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up Git
# run: |
# git config --global user.name "kubbot"
# git config --global user.email "[email protected]"
- name: Pull in Chinese posts
uses: gautamkrishnar/blog-post-workflow@v1
with:
comment_tag_name: "My-Blog-TW"
feed_list: "https://nsddd.top/zh-tw/index.xml"
token: ${{ secrets.BOT_GITHUB_TOKEN }}
max_post_count: 100
commit_message: "🔥docs(main): update with latest RadioGeek feed from TW"
committer_username: "kubbot"
disable_html_encoding: true
# 运行一系列 shell 命令,配置本地 Git 设置,从远程库拉取最新版本并推送到远程库。
- name: Auto green
run: |
git config --local user.email "[email protected]"
git config --local user.name "kubbot"
git remote set-url origin https://${{ secrets.BOT_GITHUB_TOKEN }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git pull --rebase
# 将 UTC 时间转换为上海时间
local_time=$(date -u -d "$(date -u)" "+%Y-%m-%d %H:%M:%S" -d "8 hours")
# 允许空提交,-a 省略git add . 而且设置签名
git commit --allow-empty -a -s -m "🌟 You never lose, either you win or you learn! 💪"
git push