From 6976fd7b5368344bd2ab299c0a75de1f093e6346 Mon Sep 17 00:00:00 2001 From: "LINING-PC\\lining" Date: Wed, 2 Jul 2025 14:16:01 +0800 Subject: [PATCH] v1.0.2 - update --- .github/workflows/deploy-github-pages.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-github-pages.yml b/.github/workflows/deploy-github-pages.yml index 131bf6f..74759bd 100644 --- a/.github/workflows/deploy-github-pages.yml +++ b/.github/workflows/deploy-github-pages.yml @@ -1,8 +1,13 @@ name: Deploy GitHub Pages on: - watch: - types: [started] + workflow_dispatch: + inputs: + deploy_message: + description: 'Deployment message' + required: false + default: 'Manual deployment' + type: string # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -20,11 +25,22 @@ jobs: # Build job build: runs-on: ubuntu-latest - if: github.event.repository.owner.id == github.event.sender.id + # 权限控制:只允许特定用户或仓库所有者触发 + if: github.actor == github.repository_owner || github.actor == 'nelson820125' || contains(fromJson('["nelson820125", "other-user"]'), github.actor) steps: - name: Checkout uses: actions/checkout@v4 + - name: Check permissions + run: | + echo "Triggered by: ${{ github.actor }}" + echo "Repository owner: ${{ github.repository_owner }}" + echo "Event name: ${{ github.event_name }}" + + - name: Show deployment message + run: | + echo "Deployment message: ${{ github.event.inputs.deploy_message || 'Manual deployment' }}" + - name: Setup Node.js uses: actions/setup-node@v4 with: