From cd9a22d7530baf33890971b01af8798069c3fea9 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 25 May 2025 13:42:32 +0200 Subject: [PATCH] workflows/eval: fix comparison with merge conflicts In PRs with multiple commits and merge conflicts the logic "targetSha == immediate parent of mergedSha" doesn't hold anymore. The head and base commits of the PR's branch have some commits inbetween them, instead. Before this change, we'd get a "fatal: invalid reference" on the "worktree add". Now, not anymore, because we fetch the right commit directly. --- .github/workflows/eval.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/eval.yml b/.github/workflows/eval.yml index bec9c23de6a0..3acfbdf25e37 100644 --- a/.github/workflows/eval.yml +++ b/.github/workflows/eval.yml @@ -101,7 +101,6 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ needs.prepare.outputs.mergedSha }} - fetch-depth: 2 path: nixpkgs - name: Install Nix @@ -168,6 +167,7 @@ jobs: env: AUTHOR_ID: ${{ github.event.pull_request.user.id }} run: | + git -C nixpkgs fetch --depth 1 origin ${{ needs.prepare.outputs.targetSha }} git -C nixpkgs worktree add ../target ${{ needs.prepare.outputs.targetSha }} git -C nixpkgs diff --name-only ${{ needs.prepare.outputs.targetSha }} \ | jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json