From 1867eb503438fc9664cd390c4f32c52737ffc8f3 Mon Sep 17 00:00:00 2001 From: Gavin John Date: Thu, 13 Feb 2025 13:58:28 -0800 Subject: [PATCH] Update nur-search fix --- .github/workflows/update.yml | 24 +++++++++++++++++++++++- ci/update-nur-search.sh | 9 +-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 0795d4798..a213e4900 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -97,12 +97,34 @@ jobs: permissions: "contents:write" revoke_token: true - uses: actions/checkout@v4 + with: + repository: nix-community/NUR + fetch-depth: '0' + path: nur + - uses: actions/checkout@v4 + with: + repository: nix-community/nur-combined + fetch-depth: '0' + submodules: 'recursive' + path: nur-combined + - uses: actions/checkout@v4 + with: + repository: nix-community/nur-search + fetch-depth: '0' + path: nur-search - uses: cachix/install-nix-action@v30 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | experimental-features = nix-command flakes - name: update nur-search/data/packages.json - run: ./ci/update-nur-search.sh + run: ./nur/ci/update-nur-search.sh env: API_TOKEN_GITHUB: '${{ steps.get_workflow_token.outputs.token }}' + - name: rebase and push + run: | + source ./nur/ci/lib/setup-git.sh + git -C $GITHUB_WORKSPACE/nur-search pull --rebase origin master + git -C $GITHUB_WORKSPACE/nur-search push origin HEAD:master + env: + GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }} diff --git a/ci/update-nur-search.sh b/ci/update-nur-search.sh index 95cd16f59..c97e9bf1e 100755 --- a/ci/update-nur-search.sh +++ b/ci/update-nur-search.sh @@ -14,11 +14,7 @@ set -x nix build "${DIR}#" -cd "${DIR}/.." - -git clone --single-branch "https://${API_TOKEN_GITHUB:-git}@github.com/nix-community/nur-combined.git" || git -C nur-combined pull - -git clone --recurse-submodules "https://${API_TOKEN_GITHUB:-git}@github.com/nix-community/nur-search.git" || git -C nur-search pull +cd "${DIR}/../.." nix run "${DIR}#" -- index nur-combined > nur-search/data/packages.json @@ -29,9 +25,6 @@ cd nur-search if [[ ! -z "$(git diff --exit-code)" ]]; then git add ./data/packages.json git commit -m "automatic update package.json" - git pull --rebase origin master - git push origin master - nix-shell --run "make clean && make && make publish" else echo "nothings changed will not commit anything" fi