feat: set teapot.env
All checks were successful
push / build (push) Successful in 1m58s

This commit is contained in:
张泊明518370910136 2025-06-25 08:24:13 -04:00
parent f810209122
commit f128933252
GPG Key ID: CA088E6D9284F870

View File

@ -1,11 +1,10 @@
#!/usr/bin/bash #!/usr/bin/bash
set -ex set -ex
if [ -z "$1" ]; then ORG_NAME=$(basename "$(dirname "$(pwd)")")
COURSE=$(hostname | cut -d'/' -f2 | cut -d'-' -f1) REPO_NAME=$(basename "$(pwd)")
else
COURSE="$1" COURSE=${REPO_NAME%-*}
fi
CONFIG_REPO_PATH="/home/tt/.cache/$COURSE-config" CONFIG_REPO_PATH="/home/tt/.cache/$COURSE-config"
GRADING_REPO_PATH="/home/tt/.cache/$COURSE-joj" GRADING_REPO_PATH="/home/tt/.cache/$COURSE-joj"
GIT_USER="bot-$COURSE" GIT_USER="bot-$COURSE"
@ -40,3 +39,8 @@ if ! git -C "$CONFIG_REPO_PATH" diff --staged --quiet; then
git -C "$CONFIG_REPO_PATH" commit -m "chore: joj3-forge convert [skip ci]" git -C "$CONFIG_REPO_PATH" commit -m "chore: joj3-forge convert [skip ci]"
git -C "$CONFIG_REPO_PATH" push git -C "$CONFIG_REPO_PATH" push
fi fi
if [ -n "$TEAPOT_GITEA_TOKEN" ]; then
mkdir -p /home/tt/.config/teapot
echo "GITEA_ORG_NAME=$ORG_NAME" >"/home/tt/.config/teapot/teapot.env"
echo "GITEA_ACCESS_TOKEN=$TEAPOT_GITEA_TOKEN" >>"/home/tt/.config/teapot/teapot.env"
fi