Auto-sync: 2026-03-01 17:29:03
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
set -e
|
||||
export PATH=/usr/bin:/usr/local/bin:/usr/sbin:/sbin:/bin:$PATH
|
||||
|
||||
GREEN="[0;32m"
|
||||
YELLOW="[1;33m"
|
||||
RED="[0;31m"
|
||||
NC="[0m"
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user