From 73473462fb2c48298324963e7a0c61601ff3a8ed Mon Sep 17 00:00:00 2001 From: Etgpao <104690059+paopaoandlingyia@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:59:50 +0800 Subject: [PATCH] sync: fallback to PAT_TOKEN secret when override-token is empty (#181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update token usage in sync workflow * sync: fallback to PAT_TOKEN secret when override-token is empty Explain briefly: UI input field doesn’t evaluate ${{ secrets.* }}, users may paste it and it becomes a literal string. Add fallback to secrets.PAT_TOKEN to make workflow_dispatch easier and safer. * More detailed desc --------- Co-authored-by: lyc8503 --- .github/workflows/sync.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 4aee640..bf4a21f 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -13,7 +13,7 @@ on: required: true default: false override-token: - description: '[Optional] Replace the default token with the supplied PAT. Used to resolve `refusing to allow a GitHub App to create or update workflow... `' + description: '[Optional] Paste a PAT here. If left blank, PAT_TOKEN secret will be used (if set). Used to solve `refusing to allow a GitHub App to create or update workflow... `, more info at https://github.com/lyc8503/UptimeFlare/wiki/Synchronize-updates-from-upstream#upgrade-methods' required: false jobs: @@ -25,7 +25,7 @@ jobs: - name: Checkout target repo uses: actions/checkout@v3 with: - token: ${{ inputs.override-token || secrets.GITHUB_TOKEN }} + token: ${{ inputs.override-token || secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} - name: Current config run: |