Auto-sync: 2026-03-01 17:29:03

This commit is contained in:
Windmill Bot
2026-03-01 17:29:03 +00:00
parent dcca6ee056
commit 33a4f5ad7b
3 changed files with 24 additions and 19 deletions

View File

@@ -2,10 +2,10 @@
set -e
export PATH=/usr/bin:/usr/local/bin:/usr/sbin:/sbin:/bin:$PATH
GREEN=""
YELLOW=""
RED=""
NC=""
GREEN="\033[0;32m"
YELLOW="\033[1;33m"
RED="\033[0;31m"
NC="\033[0m"
echo -e "${GREEN}=== Windmill Workflow Git Sync ===${NC}"
@@ -22,6 +22,19 @@ git config --global --add safe.directory "$REPO_ROOT"
git config --global user.email "bot@keinafarm.net"
git config --global user.name "Windmill Bot"
# sync ブランチを使用
CURRENT_BRANCH=$(git -C "$REPO_ROOT" rev-parse --abbrev-ref HEAD)
if [ "$CURRENT_BRANCH" != "sync" ]; then
echo -e "${YELLOW}Switching to sync branch...${NC}"
git -C "$REPO_ROOT" fetch origin sync
git -C "$REPO_ROOT" checkout sync
fi
echo -e "${YELLOW}Pulling from origin/sync...${NC}"
git -C "$REPO_ROOT" pull --rebase origin sync || {
echo -e "${RED}Failed to pull from remote. Continuing...${NC}"
}
echo -e "${YELLOW}Pulling from Windmill...${NC}"
cd "$WMILL_DIR"
wmill sync pull --config-dir /workspace/wmill_config --skip-variables --skip-secrets --skip-resources --yes || exit 1
@@ -32,15 +45,12 @@ if [[ -n $(git status --porcelain) ]]; then
git add -A
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
git commit -m "Auto-sync: ${TIMESTAMP}"
echo -e "${YELLOW}Pushing to Gitea...${NC}"
git pull --rebase origin main || {
echo -e "${RED}Failed to pull from remote. Trying push anyway...${NC}"
}
git push origin main || {
echo -e "${YELLOW}Pushing to Gitea (sync branch)...${NC}"
git push origin sync || {
echo -e "${RED}Failed to push.${NC}"
exit 1
}
echo -e "${GREEN}Changes pushed to Gitea${NC}"
echo -e "${GREEN}Changes pushed to Gitea (sync branch)${NC}"
else
echo -e "${GREEN}No changes detected${NC}"
fi

View File

@@ -1,5 +1,5 @@
summary: Git Sync Workflow
description: Automatically sync Windmill workflows to Git repository
description: Automatically sync Windmill workflows to Git repository (sync branch)
value:
modules:
- id: a
@@ -9,9 +9,4 @@ value:
input_transforms: {}
lock: ''
language: bash
schema:
$schema: 'https://json-schema.org/draft/2020-12/schema'
type: object
order: []
properties: {}
required: []
schema: null