Ensure screen command always succeeds
All checks were successful
Build and Deploy Spring Boot / build-and-deploy (push) Successful in 34s

Modified the `screen` command to append `; true` ensuring the step does not fail even if no screen session is found, thus making the workflow more robust.
This commit is contained in:
hxuanyu 2024-11-04 18:34:08 +08:00
parent 0f5a67079e
commit 76cc99fae8

View File

@ -56,7 +56,7 @@ jobs:
password: ${{ secrets.SERVER_PASSWORD }} password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }} port: ${{ secrets.SERVER_PORT }}
script: | script: |
screen -list | grep -q "${{ vars.APP_NAME }}" && screen -S ${{ vars.APP_NAME }} -X quit screen -list | grep -q "${{ vars.APP_NAME }}" && screen -S ${{ vars.APP_NAME }} -X quit; true
# 使用新版jar包启动应用 # 使用新版jar包启动应用
- name: 使用新版jar包启动应用 - name: 使用新版jar包启动应用
uses: appleboy/ssh-action@master uses: appleboy/ssh-action@master