name: 回退开发环境 Nacos 配置 "on": workflow_dispatch: inputs: snapshot_id: description: 可选快照 ID,留空使用待回退快照 required: false type: string auto_rollback: description: 是否由自动失败流程触发 required: false type: boolean concurrency: group: release-dev cancel-in-progress: false jobs: rollback: runs-on: jayucloud container: options: >- -v /opt/software/panel/apps/gitea/act_runner/salon-release:/salon-release env: NACOS_ENVIRONMENT: dev RELEASE_STORE_ROOT: /salon-release NACOS_SNAPSHOT_ID: ${{ inputs.snapshot_id }} NACOS_DEV_URLS: ${{ secrets.NACOS_DEV_URLS }} NACOS_DEV_USERNAME: ${{ secrets.NACOS_DEV_USERNAME }} NACOS_DEV_PASSWORD: ${{ secrets.NACOS_DEV_PASSWORD }} AUTO_ROLLBACK: ${{ inputs.auto_rollback }} steps: - name: 检出回退脚本 shell: bash env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_SERVER_URL: http://192.168.5.15:3000 run: | git init . git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" git -c http.extraheader="Authorization: token $GITEA_TOKEN" fetch --no-tags --depth=1 origin "$GITHUB_SHA" git checkout --detach "$GITHUB_SHA" - name: 恢复并校验 Nacos shell: bash run: AUTO_ROLLBACK=${AUTO_ROLLBACK:-false} node .gitea/scripts/rollback-nacos.mjs