From 22c8bc9b9b59aecfbdb595bb228a0176ce02f810 Mon Sep 17 00:00:00 2001 From: Nikolai Nechaev Date: Sun, 21 Sep 2025 22:07:41 +0900 Subject: [PATCH] CI/Nix: Allow running CI in forks Rather than hardcoding the repository name in the workflow file, use a context value. This allows running workflows in forks. --- .github/workflows/nix-ci.yml | 4 ++-- .github/workflows/nix-test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index 1c52d0ab7..ae6150578 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/nix.yml secrets: inherit with: - command: nix build 'github:hyprwm/Hyprland?ref=${{ github.ref }}' -L --extra-substituters "https://hyprland.cachix.org" + command: nix build 'github:${{ github.repository }}?ref=${{ github.ref }}' -L --extra-substituters "https://hyprland.cachix.org" xdph: if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) @@ -21,7 +21,7 @@ jobs: uses: ./.github/workflows/nix.yml secrets: inherit with: - command: nix build 'github:hyprwm/Hyprland?ref=${{ github.ref }}#xdg-desktop-portal-hyprland' -L --extra-substituters "https://hyprland.cachix.org" + command: nix build 'github:${{ github.repository }}?ref=${{ github.ref }}#xdg-desktop-portal-hyprland' -L --extra-substituters "https://hyprland.cachix.org" test: if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) diff --git a/.github/workflows/nix-test.yml b/.github/workflows/nix-test.yml index a4e32b566..086f0077c 100644 --- a/.github/workflows/nix-test.yml +++ b/.github/workflows/nix-test.yml @@ -46,7 +46,7 @@ jobs: authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - name: Run test VM - run: nix build 'github:hyprwm/Hyprland?ref=${{ github.ref }}#checks.x86_64-linux.tests' -L --extra-substituters "https://hyprland.cachix.org" + run: nix build 'github:${{ github.repository }}?ref=${{ github.ref }}#checks.x86_64-linux.tests' -L --extra-substituters "https://hyprland.cachix.org" - name: Check exit status run: grep 0 result/exit_status