action-ensure-tea-login: init

This commit is contained in:
DavHau 2023-07-28 13:04:09 +02:00
parent 7aedda8aea
commit 414379e6bd
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,23 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.tea
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$(tea login list -o simple | wc -l)" -gt 0 ]; then
exit 0
fi
tea login add \
--token $GITEA_TOKEN