From 5fb815a3c18bb9fad126dbd2c66510f322af40aa Mon Sep 17 00:00:00 2001 From: datadunia Date: Wed, 17 Jun 2026 10:56:27 +0700 Subject: [PATCH] fix(ci): move token+persist-credentials to test job checkout, insteadOf after checkout Test jobs failed because actions/checkout@v4 erases global insteadOf during 'Setting up auth for fetching submodules', replacing it with SSH mappings that don't help with x-access-token auth. Fix: Add token + persist-credentials to checkout (same pattern as reusable build workflows that pass), and move insteadOf after checkout as a safety net for subsequent git operations. --- .gitea/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2137f82..78b1833 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -15,12 +15,14 @@ jobs: if: contains(gitea.ref_name, 'test') runs-on: ubuntu-latest steps: - - name: Configure git auth for submodules - run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 + token: ${{ secrets.BUILD_TOKEN }} + persist-credentials: true + - name: Configure git auth for submodules + run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/setup-go@v5 with: go-version: '1.26' @@ -37,12 +39,14 @@ jobs: if: contains(gitea.ref_name, 'test') runs-on: ubuntu-latest steps: - - name: Configure git auth for submodules - run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 + token: ${{ secrets.BUILD_TOKEN }} + persist-credentials: true + - name: Configure git auth for submodules + run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/setup-go@v5 with: go-version: '1.26' @@ -54,12 +58,14 @@ jobs: if: contains(gitea.ref_name, 'test') runs-on: ubuntu-latest steps: - - name: Configure git auth for submodules - run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 + token: ${{ secrets.BUILD_TOKEN }} + persist-credentials: true + - name: Configure git auth for submodules + run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/" - uses: actions/setup-node@v4 with: node-version: '24'