From ae29ae9b88fe8674a9ffd7d730daeba3b44f6976 Mon Sep 17 00:00:00 2001 From: yichuan520030910320 Date: Wed, 24 Dec 2025 12:16:38 +0800 Subject: [PATCH] fix: use proper conditional expression for token fallback - Use conditional expression to check if GH_PAT exists before using it - Fallback to GITHUB_TOKEN if GH_PAT is not set or empty - This fixes the 'token not supplied' error --- .github/workflows/build-reusable.yml | 4 ++-- .github/workflows/link-check.yml | 2 +- .github/workflows/release-manual.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index 7a9b288..669e796 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -18,7 +18,7 @@ jobs: with: submodules: recursive fetch-depth: 1 - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }} ref: ${{ inputs.ref }} - name: Install uv and Python @@ -95,7 +95,7 @@ jobs: with: submodules: recursive fetch-depth: 1 - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }} ref: ${{ inputs.ref }} - name: Install uv and Python diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index c87ae5b..d13db83 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 1 - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }} - uses: lycheeverse/lychee-action@v2 with: args: --no-progress --insecure --user-agent 'curl/7.68.0' --exclude '.*api\.star-history\.com.*' --accept 200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,306,307,308,503 README.md docs/ apps/ examples/ benchmarks/ diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index 5a0fb77..74c2766 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 1 - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }} - name: Validate version run: | @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 1 - token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }} + token: ${{ secrets.GH_PAT != '' && secrets.GH_PAT || secrets.GITHUB_TOKEN }} ref: 'main' - name: Download all artifacts