mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 19:57:04 +08:00
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Update cmdpriv-template
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'pkg/qqbot/cmds/**'
|
|
pull_request:
|
|
types: [closed]
|
|
paths:
|
|
- 'pkg/qqbot/cmds/**'
|
|
|
|
jobs:
|
|
update-cmdpriv-template:
|
|
if: github.event.pull_request.merged == true || github.event_name == 'push'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.10.13
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade yiri-mirai-rc openai>=1.0.0 colorlog func_timeout dulwich Pillow CallingGPT tiktoken
|
|
python -m pip install -U openai>=1.0.0
|
|
|
|
- name: Copy Scripts
|
|
run: |
|
|
cp res/scripts/generate_cmdpriv_template.py .
|
|
|
|
- name: Generate Files
|
|
run: |
|
|
python main.py
|
|
|
|
- name: Run generate_cmdpriv_template.py
|
|
run: python3 generate_cmdpriv_template.py
|
|
|
|
- name: Check for changes in cmdpriv-template.json
|
|
id: check_changes
|
|
run: |
|
|
if git diff --name-only | grep -q "res/templates/cmdpriv-template.json"; then
|
|
echo "::set-output name=changes_detected::true"
|
|
else
|
|
echo "::set-output name=changes_detected::false"
|
|
fi
|
|
|
|
- name: Commit changes to cmdpriv-template.json
|
|
if: steps.check_changes.outputs.changes_detected == 'true'
|
|
run: |
|
|
git config --global user.name "GitHub Actions Bot"
|
|
git config --global user.email "<github-actions@github.com>"
|
|
git add res/templates/cmdpriv-template.json
|
|
git commit -m "Update cmdpriv-template.json"
|
|
git push
|