From 6fe72a304ba536d0b47a8d889269acdcb9a38af0 Mon Sep 17 00:00:00 2001 From: Xika Date: Tue, 12 May 2026 12:18:19 +0000 Subject: [PATCH] fix(ci): drop lint from staging deploy; fix revert for merge commits (BIT-21923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove `npm run lint --quiet` from SSH deploy step: eslint is a devDependency excluded by --omit=dev, and CI already passed lint before the merge — re-running on staging is both redundant and broken. - Change `git revert HEAD --no-edit` to `git revert HEAD -m 1 --no-edit` so the rollback step handles merge commits correctly. --- .gitea/workflows/deploy-staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy-staging.yml b/.gitea/workflows/deploy-staging.yml index 757787c..2f576f5 100644 --- a/.gitea/workflows/deploy-staging.yml +++ b/.gitea/workflows/deploy-staging.yml @@ -45,7 +45,7 @@ jobs: set -euo pipefail BRANCH="${STAGING_GIT_BRANCH:?STAGING_GIT_BRANCH is required}" bash tools/ci/gitea-actions-ssh-config.sh staging "$STAGING_HOST" "$STAGING_USER" "$STAGING_PORT" "$STAGING_SSH_KEY" "$STAGING_SSH_KNOWN_HOSTS" - ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev && npm run lint --quiet" + ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev" ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && pm2 startOrReload ecosystem.config.cjs --update-env" - name: Health check — staging @@ -76,7 +76,7 @@ jobs: bash tools/ci/gitea-actions-ssh-config.sh staging "$STAGING_HOST" "$STAGING_USER" "$STAGING_PORT" "$STAGING_SSH_KEY" "$STAGING_SSH_KNOWN_HOSTS" echo "Attempting automatic rollback to previous commit..." ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git log --oneline -2" - ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git revert HEAD --no-edit && git push origin ${BRANCH}" + ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git revert HEAD -m 1 --no-edit && git push origin ${BRANCH}" ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev && pm2 startOrReload ecosystem.config.cjs --update-env" echo "Staging deployment failed — rollback attempted" exit 1 -- 2.47.3