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
This commit is contained in:
yichuan520030910320
2025-12-24 12:16:38 +08:00
parent e5977e4c4f
commit ae29ae9b88
3 changed files with 5 additions and 5 deletions

View File

@@ -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