https://github.com/tonicai/structural-export-workspace
A Github Action to export the configuration stored in your Tonic Structural workspace
https://github.com/tonicai/structural-export-workspace
Last synced: 2 months ago
JSON representation
A Github Action to export the configuration stored in your Tonic Structural workspace
- Host: GitHub
- URL: https://github.com/tonicai/structural-export-workspace
- Owner: TonicAI
- License: mit
- Created: 2025-04-22T21:28:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-30T21:13:13.000Z (about 1 year ago)
- Last Synced: 2025-04-30T22:24:30.282Z (about 1 year ago)
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Export Workspace Configuration
This action exports the configuration stored in your Tonic Structural workspace.
## Inputs
- `api_key` (required): Structural API key with access to the workspace
- `workspace_id` (required): ID of the Structural workspace to export
- `base-url` (optional): Base URL for Structural API, defaults to 'https://app.tonic.ai'
- `output_path` (optional): Path where the export file will be saved, defaults to 'workspace-export.json'
## Outputs
- `export_path`: Path to the exported workspace configuration file
## Example Usage
### Basic Usage
```yaml
steps:
- name: Export Structural workspace
id: export
uses: TonicAI/structural-export-workspace@v1
with:
api_key: ${{ secrets.STRUCTURAL_API_KEY }}
workspace_id: ${{ vars.STRUCTURAL_WORKSPACE_ID }}
```
### Complete Workflow Example
```yaml
name: Export Structural Workspace
on:
workflow_dispatch:
inputs:
workspace_id:
description: 'ID of the Structural workspace to export'
required: true
type: string
jobs:
export:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set timestamp
id: timestamp
run: echo "timestamp=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT
- name: Export Structural workspace
id: export
uses: TonicAI/structural-export-workspace@v1
with:
api_key: ${{ secrets.STRUCTURAL_API_KEY }}
workspace_id: ${{ github.event.inputs.workspace_id }}
output_path: "./exports/workspace-config.json"
- name: Create timestamped copy
run: |
cp "${{ steps.export.outputs.export_path }}" "./exports/workspace-config-${{ steps.timestamp.outputs.timestamp }}.json"
- name: Commit changes
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add ./exports/
git commit -m "Workspace export $(date +'%Y-%m-%d')" || echo "No changes to commit"
git push
```
## Security
This action requires a Structural API key with permissions to export the workspace configuration. Store this key as a secret in your GitHub repository and reference it as shown in the example workflow.