refactor: checkout no longer depends on node actions

This commit is contained in:
2026-04-24 15:19:35 +08:00
parent c2785f0746
commit b99fe66704
+23 -3
View File
@@ -16,9 +16,29 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
github-server-url: ${{ github.server_url }}
env:
SERVER_URL: ${{ github.server_url }}
REPOSITORY: ${{ github.repository }}
COMMIT_SHA: ${{ github.sha }}
GIT_USERNAME: ${{ github.actor }}
GIT_TOKEN: ${{ github.token }}
run: |
case "$SERVER_URL" in
http://*)
AUTH_SERVER_URL="http://${GIT_USERNAME}:${GIT_TOKEN}@${SERVER_URL#http://}"
;;
https://*)
AUTH_SERVER_URL="https://${GIT_USERNAME}:${GIT_TOKEN}@${SERVER_URL#https://}"
;;
*)
AUTH_SERVER_URL="$SERVER_URL"
;;
esac
git init .
git remote add origin "${AUTH_SERVER_URL}/${REPOSITORY}.git"
git fetch --depth=1 origin "$COMMIT_SHA"
git checkout --detach FETCH_HEAD
- name: Normalize image metadata
env: