From e59d3a010b529013cca899e64ad39e4c57e9b5f0 Mon Sep 17 00:00:00 2001 From: Julien Gautier Date: Mon, 4 May 2026 13:28:19 +0200 Subject: [PATCH] fix(ci): drop invalid `git fetch --depth=0` in Nx base resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `actions/checkout@v4` already runs with `fetch-depth: 0`, which pulls every branch and tag — origin/ is therefore present locally and the explicit fetch is redundant. The flag value `--depth=0` is itself invalid (git requires a positive integer), so the step failed with `fatal: depth 0 is not a positive number` on every PR run. --- .gitea/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 139f51a..80db345 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -27,8 +27,11 @@ jobs: - name: Derive Nx affected base and head shell: bash run: | + # `actions/checkout@v4` with fetch-depth: 0 already pulls every + # branch and tag, so origin/ is present locally — no + # extra `git fetch` is needed (and `--depth=0` is invalid: git + # requires a positive integer). if [ "${{ github.event_name }}" = "pull_request" ]; then - git fetch origin "${{ github.base_ref }}" --depth=0 echo "NX_BASE=$(git merge-base HEAD origin/${{ github.base_ref }})" >> "$GITHUB_ENV" else echo "NX_BASE=HEAD~1" >> "$GITHUB_ENV"