mirror of https://github.com/Mai-with-u/MaiBot.git
commit
262224cd30
|
|
@ -22,18 +22,18 @@ jobs:
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Determine Image Tags
|
- name: Determine Image Tags
|
||||||
id: tags
|
id: tags
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||||
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/maimbot:${{ github.ref_name }},${{ secrets.DOCKERHUB_USERNAME }}/maimbot:latest" >> $GITHUB_OUTPUT
|
echo "tags=${{ vars.DOCKERHUB_USERNAME }}/maimbot:${{ github.ref_name }},${{ vars.DOCKERHUB_USERNAME }}/maimbot:latest" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||||
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/maimbot:main,${{ secrets.DOCKERHUB_USERNAME }}/maimbot:latest" >> $GITHUB_OUTPUT
|
echo "tags=${{ vars.DOCKERHUB_USERNAME }}/maimbot:main,${{ vars.DOCKERHUB_USERNAME }}/maimbot:latest" >> $GITHUB_OUTPUT
|
||||||
elif [ "${{ github.ref }}" == "refs/heads/main-fix" ]; then
|
elif [ "${{ github.ref }}" == "refs/heads/main-fix" ]; then
|
||||||
echo "tags=${{ secrets.DOCKERHUB_USERNAME }}/maimbot:main-fix" >> $GITHUB_OUTPUT
|
echo "tags=${{ vars.DOCKERHUB_USERNAME }}/maimbot:main-fix" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
|
|
@ -44,5 +44,5 @@ jobs:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: ${{ steps.tags.outputs.tags }}
|
tags: ${{ steps.tags.outputs.tags }}
|
||||||
push: true
|
push: true
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/maimbot:buildcache
|
cache-from: type=registry,ref=${{ vars.DOCKERHUB_USERNAME }}/maimbot:buildcache
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/maimbot:buildcache,mode=max
|
cache-to: type=registry,ref=${{ vars.DOCKERHUB_USERNAME }}/maimbot:buildcache,mode=max
|
||||||
|
|
|
||||||
8
bot.py
8
bot.py
|
|
@ -203,6 +203,9 @@ def check_eula():
|
||||||
if eula_new_hash == confirmed_content:
|
if eula_new_hash == confirmed_content:
|
||||||
eula_confirmed = True
|
eula_confirmed = True
|
||||||
eula_updated = False
|
eula_updated = False
|
||||||
|
if eula_new_hash == os.getenv("EULA_AGREE"):
|
||||||
|
eula_confirmed = True
|
||||||
|
eula_updated = False
|
||||||
|
|
||||||
# 检查隐私条款确认文件是否存在
|
# 检查隐私条款确认文件是否存在
|
||||||
if privacy_confirm_file.exists():
|
if privacy_confirm_file.exists():
|
||||||
|
|
@ -211,11 +214,14 @@ def check_eula():
|
||||||
if privacy_new_hash == confirmed_content:
|
if privacy_new_hash == confirmed_content:
|
||||||
privacy_confirmed = True
|
privacy_confirmed = True
|
||||||
privacy_updated = False
|
privacy_updated = False
|
||||||
|
if privacy_new_hash == os.getenv("PRIVACY_AGREE"):
|
||||||
|
privacy_confirmed = True
|
||||||
|
privacy_updated = False
|
||||||
|
|
||||||
# 如果EULA或隐私条款有更新,提示用户重新确认
|
# 如果EULA或隐私条款有更新,提示用户重新确认
|
||||||
if eula_updated or privacy_updated:
|
if eula_updated or privacy_updated:
|
||||||
print("EULA或隐私条款内容已更新,请在阅读后重新确认,继续运行视为同意更新后的以上两款协议")
|
print("EULA或隐私条款内容已更新,请在阅读后重新确认,继续运行视为同意更新后的以上两款协议")
|
||||||
print('输入"同意"或"confirmed"继续运行')
|
print(f'输入"同意"或"confirmed"或设置环境变量"EULA_AGREE={eula_new_hash}"和"PRIVACY_AGREE={privacy_new_hash}"继续运行')
|
||||||
while True:
|
while True:
|
||||||
user_input = input().strip().lower()
|
user_input = input().strip().lower()
|
||||||
if user_input in ["同意", "confirmed"]:
|
if user_input in ["同意", "confirmed"]:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue