调整流水线

This commit is contained in:
2026-04-16 13:46:19 +08:00
parent 5037d83b3d
commit 8778d641ab

View File

@@ -39,6 +39,9 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ${{ inputs.runs_on }} runs-on: ${{ inputs.runs_on }}
defaults:
run:
shell: bash
env: env:
NPM_CONFIG_REGISTRY: ${{ inputs.npm_registry }} NPM_CONFIG_REGISTRY: ${{ inputs.npm_registry }}
steps: steps:
@@ -46,13 +49,16 @@ jobs:
env: env:
GITEA_HOST: git.jc2009.com GITEA_HOST: git.jc2009.com
GITEA_TOKEN: ${{ github.token }} GITEA_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
run: | run: |
set -euo pipefail set -euo pipefail
git config --global --add safe.directory '*' git config --global --add safe.directory '*'
REPO="${{ github.repository }}" REPO="${{ github.repository }}"
SHA="${{ github.sha }}" SHA="${{ github.sha }}"
BRANCH="${{ github.ref_name }}" BRANCH="${{ github.ref_name }}"
URL="https://x-access-token:${GITEA_TOKEN}@${GITEA_HOST}/${REPO}.git" TOKEN="${GITEA_TOKEN:-${GITHUB_TOKEN:-}}"
test -n "$TOKEN" || { echo "Checkout: empty token (github.token not available to this job)"; exit 1; }
URL="https://x-access-token:${TOKEN}@${GITEA_HOST}/${REPO}.git"
WS="${GITHUB_WORKSPACE:-$(pwd)}" WS="${GITHUB_WORKSPACE:-$(pwd)}"
cd "$WS" cd "$WS"
shopt -s dotglob nullglob || true shopt -s dotglob nullglob || true