fix(ci): use NPB-style checkout (git init + fetch)
This commit is contained in:
@@ -11,29 +11,20 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:22-alpine
|
image: node:22-alpine
|
||||||
options: --network bridge
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
shell: sh
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ secrets.GIT_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
|
||||||
if command -v apk >/dev/null 2>&1; then
|
|
||||||
apk add --no-cache git
|
apk add --no-cache git
|
||||||
elif command -v apt-get >/dev/null 2>&1; then
|
if [ ! -d ".git" ]; then
|
||||||
apt-get update && apt-get install -y git
|
git init
|
||||||
else
|
git remote add origin http://oauth2:${{ secrets.GIT_TOKEN }}@git.a-crm.controlsystem.kz/AVTEX/XFlow.git
|
||||||
echo "Git not found and no package manager detected"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
git fetch origin master
|
||||||
CLEAN_TOKEN=$(printf '%s' "${TOKEN}" | tr -d '\r\n')
|
git reset --hard origin/master
|
||||||
git clone "http://oauth2:${CLEAN_TOKEN}@git.a-crm.controlsystem.kz/AVTEX/XFlow.git" .
|
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user