mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-17 19:24:19 +00:00
ci: cmdpriv模板脚本
This commit is contained in:
@@ -42,7 +42,7 @@ jobs:
|
|||||||
- name: Check for changes in cmdpriv-template.json
|
- name: Check for changes in cmdpriv-template.json
|
||||||
id: check_changes
|
id: check_changes
|
||||||
run: |
|
run: |
|
||||||
if git diff --name-only | grep -q "cmdpriv-template.json"; then
|
if git diff --name-only | grep -q "res/templates/cmdpriv-template.json"; then
|
||||||
echo "::set-output name=changes_detected::true"
|
echo "::set-output name=changes_detected::true"
|
||||||
else
|
else
|
||||||
echo "::set-output name=changes_detected::false"
|
echo "::set-output name=changes_detected::false"
|
||||||
@@ -53,6 +53,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global user.name "GitHub Actions Bot"
|
git config --global user.name "GitHub Actions Bot"
|
||||||
git config --global user.email "<github-actions@github.com>"
|
git config --global user.email "<github-actions@github.com>"
|
||||||
git add cmdpriv-template.json
|
git add res/templates/cmdpriv-template.json
|
||||||
git commit -m "Update cmdpriv-template.json"
|
git commit -m "Update cmdpriv-template.json"
|
||||||
git push
|
git push
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ for key in cmdsmgr.__command_list__:
|
|||||||
template[key] = cmdsmgr.__command_list__[key]['privilege']
|
template[key] = cmdsmgr.__command_list__[key]['privilege']
|
||||||
|
|
||||||
# 写入cmdpriv-template.json
|
# 写入cmdpriv-template.json
|
||||||
with open('cmdpriv-template.json', 'w') as f:
|
with open('res/templates/cmdpriv-template.json', 'w') as f:
|
||||||
f.write(json.dumps(template, indent=4, ensure_ascii=False))
|
f.write(json.dumps(template, indent=4, ensure_ascii=False))
|
||||||
Reference in New Issue
Block a user