From bd040a0bc11f145f60253ab57c190cc8c7148431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 3 Aug 2023 16:55:53 +0200 Subject: [PATCH] inline action-checkout --- pkgs/action-checkout/default.nix | 9 --------- pkgs/action-checkout/script.sh | 10 ---------- pkgs/action-flake-update-pr-clan/default.nix | 4 ++-- pkgs/action-flake-update-pr-clan/script.sh | 3 ++- pkgs/flake-module.nix | 5 +---- 5 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 pkgs/action-checkout/default.nix delete mode 100644 pkgs/action-checkout/script.sh diff --git a/pkgs/action-checkout/default.nix b/pkgs/action-checkout/default.nix deleted file mode 100644 index df68dbb..0000000 --- a/pkgs/action-checkout/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ bash -, coreutils -, git -, openssh -, writePureShellScriptBin -}: -writePureShellScriptBin "action-checkout" [ bash coreutils git openssh ] '' - bash ${./script.sh} -'' diff --git a/pkgs/action-checkout/script.sh b/pkgs/action-checkout/script.sh deleted file mode 100644 index a901eda..0000000 --- a/pkgs/action-checkout/script.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# load BRANCH variable with default -BRANCH=${BRANCH:-main} - -# load REPO_DIR variable with default -export REPO_DIR=${REPO_DIR:-.} - -git clone --depth 1 --branch $BRANCH $REPO $REPO_DIR diff --git a/pkgs/action-flake-update-pr-clan/default.nix b/pkgs/action-flake-update-pr-clan/default.nix index 4f28a40..e44a9a8 100644 --- a/pkgs/action-flake-update-pr-clan/default.nix +++ b/pkgs/action-flake-update-pr-clan/default.nix @@ -1,6 +1,6 @@ { bash , coreutils -, action-checkout +, git , action-ensure-tea-login , action-create-pr , action-flake-update @@ -9,7 +9,7 @@ writePureShellScriptBin "action-flake-update-pr-clan" [ bash coreutils - action-checkout + git action-ensure-tea-login action-create-pr action-flake-update diff --git a/pkgs/action-flake-update-pr-clan/script.sh b/pkgs/action-flake-update-pr-clan/script.sh index 7507941..8b8dfeb 100644 --- a/pkgs/action-flake-update-pr-clan/script.sh +++ b/pkgs/action-flake-update-pr-clan/script.sh @@ -15,8 +15,9 @@ export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_NAME" export GITEA_USER="clan-bot" export GITEA_URL="https://git.clan.lol" +git clone --depth 1 --branch main "$REPO" "$REPO_DIR" action-checkout -cd $REPO_DIR +cd "$REPO_DIR" action-ensure-tea-login action-flake-update action-create-pr --assignees clan-bot diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index 7529a66..5d9985e 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -4,9 +4,6 @@ inherit (pkgs.callPackage ./renovate { }) renovate; gitea = pkgs.callPackage ./gitea { }; - action-checkout = pkgs.callPackage ./action-checkout { - inherit (config.writers) writePureShellScriptBin; - }; action-create-pr = pkgs.callPackage ./action-create-pr { inherit (config.writers) writePureShellScriptBin; }; @@ -18,7 +15,7 @@ }; action-flake-update-pr-clan = pkgs.callPackage ./action-flake-update-pr-clan { inherit (config.writers) writePureShellScriptBin; - inherit (config.packages) action-checkout action-ensure-tea-login action-create-pr action-flake-update; + inherit (config.packages) action-ensure-tea-login action-create-pr action-flake-update; }; inherit (pkgs.callPackages ./job-flake-updates { inherit (config.writers) writePureShellScriptBin;