ci: checkout without external actions (no github.com) #43
@@ -13,14 +13,32 @@ jobs:
|
|||||||
image: node:20-bookworm-slim
|
image: node:20-bookworm-slim
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install git (needed by checkout)
|
- name: Install base tools (git + certs)
|
||||||
run: |
|
run: |
|
||||||
|
set -e
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y --no-install-recommends git ca-certificates
|
apt-get install -y --no-install-recommends git ca-certificates
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
git --version
|
git --version
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout (from Gitea, no external actions)
|
||||||
uses: actions/checkout@v4
|
env:
|
||||||
|
SERVER: ${{ github.server_url }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
SHA: ${{ github.sha }}
|
||||||
|
TOKEN: ${{ secrets.CI_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
|
AUTH="$(printf "oauth2:%s" "$TOKEN" | base64 | tr -d '\n')"
|
||||||
|
git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER/$REPO.git" .
|
||||||
|
else
|
||||||
|
echo "ℹ️ CI_TOKEN absent → clone sans auth (repo public ou accès runner déjà OK)."
|
||||||
|
git clone "$SERVER/$REPO.git" .
|
||||||
|
fi
|
||||||
|
|
||||||
|
git checkout "$SHA"
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|||||||
Reference in New Issue
Block a user