fix: shallow
This commit is contained in:
@@ -18,20 +18,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Clone repository with submodules
|
- name: Clone repository with submodules
|
||||||
run: |
|
run: |
|
||||||
# 1. Bersihkan protokol https:// dari server_url menggunakan shell
|
# 1. Tentukan Header Otorisasi
|
||||||
RAW_URL="${{ gitea.server_url }}"
|
# Gitea menerima format "Bearer" untuk token aksi
|
||||||
SERVER_HOST=${RAW_URL#*//} # Menghapus https://
|
AUTH_HEADER="Authorization: Bearer ${{ gitea.token }}"
|
||||||
|
|
||||||
# 2. Set konfigurasi git secara LOKAL untuk sesi shell ini saja
|
# 2. Suntikkan konfigurasi secara dinamis (hanya untuk sesi ini)
|
||||||
# Kita gunakan GIT_CONFIG_PARAMETERS agar tidak mengotori ~/.gitconfig host
|
# Ini akan mengirimkan header ke repo utama DAN semua submodules
|
||||||
export GIT_CONFIG_COUNT=1
|
export GIT_CONFIG_COUNT=1
|
||||||
export GIT_CONFIG_KEY_0="url.https://token:${{ gitea.token }}@${SERVER_HOST}/.insteadOf"
|
export GIT_CONFIG_KEY_0="http.${{ gitea.server_url }}/.extraheader"
|
||||||
export GIT_CONFIG_VALUE_0="${{ gitea.server_url }}/"
|
export GIT_CONFIG_VALUE_0="$AUTH_HEADER"
|
||||||
|
|
||||||
# 3. Jalankan clone
|
# 3. Jalankan clone
|
||||||
|
# Gunakan variabel langsung, Git akan menangani sisanya
|
||||||
git clone --recurse-submodules ${{ gitea.server_url }}/${{ gitea.repository }}.git .
|
git clone --recurse-submodules ${{ gitea.server_url }}/${{ gitea.repository }}.git .
|
||||||
|
|
||||||
# Debug
|
# Debug untuk memastikan submodule 'app' terisi
|
||||||
ls -la app/
|
ls -la app/
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
@@ -75,20 +76,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Clone repository with submodules
|
- name: Clone repository with submodules
|
||||||
run: |
|
run: |
|
||||||
# 1. Bersihkan protokol https:// dari server_url menggunakan shell
|
# 1. Tentukan Header Otorisasi
|
||||||
RAW_URL="${{ gitea.server_url }}"
|
# Gitea menerima format "Bearer" untuk token aksi
|
||||||
SERVER_HOST=${RAW_URL#*//} # Menghapus https://
|
AUTH_HEADER="Authorization: Bearer ${{ gitea.token }}"
|
||||||
|
|
||||||
# 2. Set konfigurasi git secara LOKAL untuk sesi shell ini saja
|
# 2. Suntikkan konfigurasi secara dinamis (hanya untuk sesi ini)
|
||||||
# Kita gunakan GIT_CONFIG_PARAMETERS agar tidak mengotori ~/.gitconfig host
|
# Ini akan mengirimkan header ke repo utama DAN semua submodules
|
||||||
export GIT_CONFIG_COUNT=1
|
export GIT_CONFIG_COUNT=1
|
||||||
export GIT_CONFIG_KEY_0="url.https://token:${{ gitea.token }}@${SERVER_HOST}/.insteadOf"
|
export GIT_CONFIG_KEY_0="http.${{ gitea.server_url }}/.extraheader"
|
||||||
export GIT_CONFIG_VALUE_0="${{ gitea.server_url }}/"
|
export GIT_CONFIG_VALUE_0="$AUTH_HEADER"
|
||||||
|
|
||||||
# 3. Jalankan clone
|
# 3. Jalankan clone
|
||||||
|
# Gunakan variabel langsung, Git akan menangani sisanya
|
||||||
git clone --recurse-submodules ${{ gitea.server_url }}/${{ gitea.repository }}.git .
|
git clone --recurse-submodules ${{ gitea.server_url }}/${{ gitea.repository }}.git .
|
||||||
|
|
||||||
# Debug
|
# Debug untuk memastikan submodule 'app' terisi
|
||||||
ls -la app/
|
ls -la app/
|
||||||
- name: Generate latest.json
|
- name: Generate latest.json
|
||||||
run: |
|
run: |
|
||||||
@@ -117,7 +119,7 @@ jobs:
|
|||||||
name: latest.json
|
name: latest.json
|
||||||
path: latest.json
|
path: latest.json
|
||||||
|
|
||||||
- name: Cleanup Git Config
|
# - name: Cleanup Git Config
|
||||||
if: always() # Pastikan tetap jalan meski job gagal
|
# if: always() # Pastikan tetap jalan meski job gagal
|
||||||
run: |
|
# run: |
|
||||||
git config --global --unset-all url."https://token:${{ gitea.token }}@${{ gitea.server_url | replace("https://", "") }}/".insteadOf
|
# git config --global --unset-all url."https://token:${{ gitea.token }}@${{ gitea.server_url | replace("https://", "") }}/".insteadOf
|
||||||
|
|||||||
Reference in New Issue
Block a user