Skip to content

Add SingleStore examples (#103) #20

Add SingleStore examples (#103)

Add SingleStore examples (#103) #20

Workflow file for this run

# Copyright 2026 Columnar Technologies Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Restructure Repository
on:
workflow_dispatch:
push:
branches:
- main
jobs:
restructure:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
path: source
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Run restructure script
run: |
python source/.github/scripts/restructure.py \
--source source \
--output restructured
- name: Checkout target branch
uses: actions/checkout@v6
with:
ref: by-database
path: target
fetch-depth: 0
continue-on-error: true
- name: Create orphan branch if needed
run: |
if [ ! -d "target/.git" ]; then
mkdir -p target
cd target
git init
git checkout --orphan by-database
fi
- name: Update target branch
run: |
# Clear target directory (except .git)
cd target
find . -mindepth 1 -maxdepth 1 ! -name '.git' -exec rm -rf {} +
# Copy restructured content
cp -r ../restructured/* .
# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Commit and push
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Restructure repository (by-database view)
Source commit: ${{ github.sha }}
Triggered by: ${{ github.event_name }}"
git push origin by-database --force
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Summary
run: |
echo "## Restructured Repository" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The \`by-database\` branch has been updated with the restructured content." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Databases" >> $GITHUB_STEP_SUMMARY
ls -1 restructured | grep -v -E '^(LICENSE|README\.md)$' | while read db; do
echo "- **$db**: $(ls -1 restructured/$db | tr '\n' ', ' | sed 's/,$//')" >> $GITHUB_STEP_SUMMARY
done