Skip to content

Commit

Permalink
Fix host diffing
Browse files Browse the repository at this point in the history
Git treats the path as absolute whilst, at leas to my understanding, the
nix flake manual specifies that this ath can be relative. Thus
explicitly setting the current working directory as the path.
  • Loading branch information
e1mo committed Feb 6, 2024
1 parent bec7752 commit 39b29c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/scripts/diff-hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ fi

before_rev="$(git rev-parse "$before_ref")"
before_rev_abbr="$before_ref"
before_flake="git+file:.?ref=${before_rev}"
# Relative flake git flake urls don't work (right now?) because git treats the path as absolute
before_flake="git+file://$(pwd)?rev=${before_rev}"

after_rev="$(git rev-parse --verify HEAD)"
after_rev_abbr="$(git rev-parse --abbrev-ref HEAD)"
if [[ -z $(git status --short) ]]; then
# If the working tree is clean, we can use the latest commit hash directly
# and thus profit from even more reduced build times
after_flake="git+file:.?ref=${after_rev}"

# Somehow this doesn't work (anymore??)
after_flake="git+file://$(pwd)?rev=${after_rev}"
after_flake="."
else
# That way the script can be used to check local (non commited) changes
after_flake="."
Expand Down

0 comments on commit 39b29c5

Please sign in to comment.