Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/sync-evidence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Sync Evidence Registries

on:
workflow_dispatch:
inputs:
skip_preflight:
description: 'Skip preflight checks (not recommended)'
required: false
type: boolean
default: false
schedule:
# Run daily at 3 AM UTC
- cron: '0 3 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync-evidence:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install notion-client pyyaml

- name: Preflight checks
if: ${{ !inputs.skip_preflight }}
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
run: |
python scripts/preflight.py --bundle evidence

- name: Dry-run export
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'evidence-sync-workflow' }}
run: |
echo "Running dry-run to validate export..."
python scripts/export_bundles.py evidence --dry-run
Comment on lines +50 to +52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add missing export_bundles.py script

The sync workflow invokes python scripts/export_bundles.py evidence --dry-run/python scripts/export_bundles.py evidence, but the repository does not contain scripts/export_bundles.py (checked with find .. -name "export_bundles.py" returning no results). Every run of this job (and the governance/operations/property variants that make the same call) will fail before exporting data because the script cannot be found.

Useful? React with 👍 / 👎.


- name: Export evidence bundle
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'evidence-sync-workflow' }}
run: |
python scripts/export_bundles.py evidence

- name: Verify bundle
run: |
python scripts/verify_bundle.py evidence

- name: Check for changes
id: git_status
run: |
git diff --exit-code packages/evidence/data/ || echo "has_changes=true" >> $GITHUB_OUTPUT

- name: Commit and push
if: steps.git_status.outputs.has_changes == 'true'
run: |
git config user.name "chittyos-bot"
git config user.email "bot@users.noreply.github.com"
git add packages/evidence/
git commit -m "sync(evidence): automated export $(date +%Y-%m-%d)

Bundle: evidence
Exported by: ${{ github.actor }}
ChittyID: ${{ vars.CHITTY_ID || 'evidence-sync-workflow' }}
Workflow: ${{ github.workflow }}

🤖 Generated with Claude Code"
git push

- name: Summary
if: always()
run: |
echo "## Evidence Bundle Sync" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
echo "**Bundle:** evidence" >> $GITHUB_STEP_SUMMARY
echo "**ChittyID:** ${{ vars.CHITTY_ID || 'evidence-sync-workflow' }}" >> $GITHUB_STEP_SUMMARY
echo "**Changes:** ${{ steps.git_status.outputs.has_changes || 'none' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f packages/evidence/manifest.json ]; then
echo "### Manifest" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
cat packages/evidence/manifest.json >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
101 changes: 101 additions & 0 deletions .github/workflows/sync-governance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Sync Governance Registries

on:
workflow_dispatch:
inputs:
skip_preflight:
description: 'Skip preflight checks (not recommended)'
required: false
type: boolean
default: false
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync-governance:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install notion-client pyyaml

- name: Preflight checks
if: ${{ !inputs.skip_preflight }}
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
run: |
python scripts/preflight.py --bundle governance

- name: Dry-run export
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'governance-sync-workflow' }}
run: |
echo "Running dry-run to validate export..."
python scripts/export_bundles.py governance --dry-run

- name: Export governance bundle
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'governance-sync-workflow' }}
run: |
python scripts/export_bundles.py governance

- name: Verify bundle
run: |
python scripts/verify_bundle.py governance

- name: Check for changes
id: git_status
run: |
git diff --exit-code packages/governance/data/ || echo "has_changes=true" >> $GITHUB_OUTPUT

- name: Commit and push
if: steps.git_status.outputs.has_changes == 'true'
run: |
git config user.name "chittyos-bot"
git config user.email "bot@users.noreply.github.com"
git add packages/governance/
git commit -m "sync(governance): automated export $(date +%Y-%m-%d)

Bundle: governance
Exported by: ${{ github.actor }}
ChittyID: ${{ vars.CHITTY_ID || 'governance-sync-workflow' }}
Workflow: ${{ github.workflow }}

🤖 Generated with Claude Code"
git push

- name: Summary
if: always()
run: |
echo "## Governance Bundle Sync" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
echo "**Bundle:** governance" >> $GITHUB_STEP_SUMMARY
echo "**ChittyID:** ${{ vars.CHITTY_ID || 'governance-sync-workflow' }}" >> $GITHUB_STEP_SUMMARY
echo "**Changes:** ${{ steps.git_status.outputs.has_changes || 'none' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f packages/governance/manifest.json ]; then
echo "### Manifest" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
cat packages/governance/manifest.json >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
101 changes: 101 additions & 0 deletions .github/workflows/sync-operations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Sync Operations Registries

on:
workflow_dispatch:
inputs:
skip_preflight:
description: 'Skip preflight checks (not recommended)'
required: false
type: boolean
default: false
schedule:
# Run daily at 4 AM UTC
- cron: '0 4 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync-operations:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install notion-client pyyaml

- name: Preflight checks
if: ${{ !inputs.skip_preflight }}
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
run: |
python scripts/preflight.py --bundle operations

- name: Dry-run export
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'operations-sync-workflow' }}
run: |
echo "Running dry-run to validate export..."
python scripts/export_bundles.py operations --dry-run

- name: Export operations bundle
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
CHITTY_ID: ${{ vars.CHITTY_ID || 'operations-sync-workflow' }}
run: |
python scripts/export_bundles.py operations

- name: Verify bundle
run: |
python scripts/verify_bundle.py operations

- name: Check for changes
id: git_status
run: |
git diff --exit-code packages/operations/data/ || echo "has_changes=true" >> $GITHUB_OUTPUT

- name: Commit and push
if: steps.git_status.outputs.has_changes == 'true'
run: |
git config user.name "chittyos-bot"
git config user.email "bot@users.noreply.github.com"
git add packages/operations/
git commit -m "sync(operations): automated export $(date +%Y-%m-%d)

Bundle: operations
Exported by: ${{ github.actor }}
ChittyID: ${{ vars.CHITTY_ID || 'operations-sync-workflow' }}
Workflow: ${{ github.workflow }}

🤖 Generated with Claude Code"
git push

- name: Summary
if: always()
run: |
echo "## Operations Bundle Sync" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
echo "**Bundle:** operations" >> $GITHUB_STEP_SUMMARY
echo "**ChittyID:** ${{ vars.CHITTY_ID || 'operations-sync-workflow' }}" >> $GITHUB_STEP_SUMMARY
echo "**Changes:** ${{ steps.git_status.outputs.has_changes || 'none' }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f packages/operations/manifest.json ]; then
echo "### Manifest" >> $GITHUB_STEP_SUMMARY
echo '```json' >> $GITHUB_STEP_SUMMARY
cat packages/operations/manifest.json >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
Loading
Loading