From f0fe7a106e96890f06d613ae00d7065103833d67 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 21 Jan 2026 21:01:55 +0800 Subject: [PATCH] feat: add force deploy option to manual workflow trigger (#3) Allow manually triggering deployment even if the image tag hasn't changed --- .github/workflows/deploy.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 79dc7e4..99d37db 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,12 @@ on: schedule: - cron: '*/5 * * * *' workflow_dispatch: + inputs: + force_deploy: + description: 'Force deploy even if tag is unchanged' + required: false + type: boolean + default: false jobs: check-and-deploy: @@ -61,7 +67,11 @@ jobs: - name: Check if update needed id: check-update run: | - if [ "${{ steps.get-latest.outputs.tag }}" != "${{ steps.get-current.outputs.tag }}" ]; then + FORCE_DEPLOY="${{ inputs.force_deploy }}" + if [ "$FORCE_DEPLOY" = "true" ]; then + echo "Force deploy requested" + echo "needed=true" >> $GITHUB_OUTPUT + elif [ "${{ steps.get-latest.outputs.tag }}" != "${{ steps.get-current.outputs.tag }}" ]; then echo "Update needed: ${{ steps.get-current.outputs.tag }} -> ${{ steps.get-latest.outputs.tag }}" echo "needed=true" >> $GITHUB_OUTPUT else @@ -110,5 +120,9 @@ jobs: git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git add wrangler.toml - git commit -m "chore: update rsshub image to ${{ steps.get-latest.outputs.tag }}" - git push + if git diff --staged --quiet; then + echo "No changes to commit (force deploy with same tag)" + else + git commit -m "chore: update rsshub image to ${{ steps.get-latest.outputs.tag }}" + git push + fi