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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user