Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 21 additions & 7 deletions .github-import-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,33 @@
"lastImported": "2025-09-28T12:31:39.523Z",
"ref": "chore/fix-docs"
},
"algorandfoundation/algokit-utils-py@main": {
"name": "AlgoKit Utils Python Docs",
"repoId": "algorandfoundation/algokit-utils-py@main",
"lastCommitSha": "97fb35c271555ec58ccbaec3851ee32382c6ec68",
"lastImported": "2025-10-25T12:50:45.443Z",
"ref": "main"
},
"algorandfoundation/puya-ts@devportal": {
"name": "Algorand Typescript",
"repoId": "algorandfoundation/puya-ts@devportal",
"lastCommitSha": "e47bd211ffe3de89a8ee6818ee9849b32802dc2f",
"lastImported": "2025-10-31T11:01:46.827Z",
"ref": "devportal"
},
"algorandfoundation/puya@devportal": {
"name": "Algorand Python",
"repoId": "algorandfoundation/puya@devportal",
"lastCommitSha": "3d88a33396fdd9ce3ea311f5a1c69848dda7266e",
"lastImported": "2025-11-10T10:03:34.401Z",
"ref": "devportal"
},
"algorandfoundation/algokit-utils-py@main": {
"name": "AlgoKit Utils Python Docs",
"repoId": "algorandfoundation/algokit-utils-py@main",
"lastCommitSha": "97fb35c271555ec58ccbaec3851ee32382c6ec68",
"lastImported": "2025-11-10T10:37:29.827Z",
"ref": "main"
},
"larkiny/algokit-subscriber-ts@docs-dist": {
"name": "Algokit Subscriber TS Command Reference",
"repoId": "larkiny/algokit-subscriber-ts@docs-dist",
"lastCommitSha": "9f53c845b605c66fbab3971effa8e9a4212fe9e2",
"lastImported": "2025-11-16T09:07:04.259Z",
"ref": "docs-dist"
}
},
"lastChecked": "2025-09-25T10:01:53.956Z"
Expand Down
22 changes: 4 additions & 18 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,8 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Setup Python for importing docs
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Setup submodules
run: git submodule update --init


node-version: "20"
cache: "pnpm"
- name: Install Dependencies
run: pnpm install

Expand All @@ -64,23 +51,22 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache: "pnpm"

- name: Install D2
run: curl -fsSL https://d2lang.com/install.sh | sh -s -- --tala

- name: Setup Python for importing docs
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Setup submodules
run: git submodule update --init


- name: Install Dependencies
run: pnpm install

Expand Down
273 changes: 273 additions & 0 deletions .github/workflows/import-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
name: Import Documentation

on:
repository_dispatch:
types: [docs_updated]

workflow_dispatch:
inputs:
source_repo:
description: "Source repository to import docs from (optional)"
required: false
type: string
version:
description: "Version to import (default: latest)"
required: false
type: string
default: "latest"

permissions:
contents: write
pull-requests: write
actions: write

jobs:
import-documentation:
name: Import Documentation and Create PR
runs-on: ubuntu-latest
timeout-minutes: 30
env:
AUTOMATION_TOKEN: ${{ secrets.IMPORT_DOCS_TOKEN }}

steps:
- name: Validate Automation Token
run: |
if [ -z "$AUTOMATION_TOKEN" ]; then
echo "❌ Missing IMPORT_DOCS_TOKEN secret. Please add a PAT with 'repo' and 'workflow' scopes." >&2
exit 1
fi

- name: Checkout DevPortal
uses: actions/checkout@v4
with:
token: ${{ env.AUTOMATION_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10.6.3

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Log Trigger Information
run: |
echo "🔄 Documentation import triggered"
echo "Event: ${{ github.event_name }}"
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "Source Repository: ${{ github.event.client_payload.source_repo }}"
echo "Source Name: ${{ github.event.client_payload.source_name }}"
echo "Branch: ${{ github.event.client_payload.branch }}"
echo "Version: ${{ github.event.client_payload.version }}"
echo "Format: ${{ github.event.client_payload.structure }}"
echo "Commit: ${{ github.event.client_payload.ref }}"
echo "Trigger Event: ${{ github.event.client_payload.trigger_event }}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "Manual trigger"
echo "Source Repository: ${{ github.event.inputs.source_repo }}"
echo "Version: ${{ github.event.inputs.version }}"
fi

- name: Set Import Environment Variables
run: |
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "SOURCE_REPO=${{ github.event.client_payload.source_repo }}" >> $GITHUB_ENV
echo "SOURCE_NAME=${{ github.event.client_payload.source_name }}" >> $GITHUB_ENV
echo "SOURCE_BRANCH=${{ github.event.client_payload.branch }}" >> $GITHUB_ENV
echo "SOURCE_VERSION=${{ github.event.client_payload.version }}" >> $GITHUB_ENV
echo "SOURCE_COMMIT=${{ github.event.client_payload.ref }}" >> $GITHUB_ENV
else
SOURCE_REPO_INPUT="${{ github.event.inputs.source_repo }}"
SOURCE_NAME_INPUT=$SOURCE_REPO_INPUT
if [ -n "$SOURCE_REPO_INPUT" ]; then
SOURCE_NAME_INPUT=$(echo "$SOURCE_REPO_INPUT" | cut -d'/' -f2)
else
SOURCE_NAME_INPUT="manual-import"
fi
echo "SOURCE_REPO=$SOURCE_REPO_INPUT" >> $GITHUB_ENV
echo "SOURCE_NAME=$SOURCE_NAME_INPUT" >> $GITHUB_ENV
echo "SOURCE_BRANCH=docs-dist" >> $GITHUB_ENV
echo "SOURCE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "SOURCE_COMMIT=unknown" >> $GITHUB_ENV
fi

- name: Clear Existing Imported Docs
run: |
echo "🧹 Clearing existing docs for $SOURCE_REPO"
if ! pnpm run import:clear "$SOURCE_REPO"; then
echo "❌ Failed to clean docs for $SOURCE_REPO. Check clean-docs-import script output for details." >&2
exit 1
fi

- name: Import Documentation
id: import
run: |
echo "📥 Starting documentation import..."
echo "Importing from: $SOURCE_REPO"
echo "Version: $SOURCE_VERSION"
pnpm run import:docs
env:
GITHUB_TOKEN: ${{ env.AUTOMATION_TOKEN }}
IMPORT_SOURCE_REPO: ${{ env.SOURCE_REPO }}
IMPORT_SOURCE_BRANCH: ${{ env.SOURCE_BRANCH }}
IMPORT_SOURCE_VERSION: ${{ env.SOURCE_VERSION }}

- name: Check for Changes
id: git-check
run: |
git add -A
if git diff --staged --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "📋 No documentation changes detected"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "📝 Documentation changes detected:"
git status --short
CHANGED_FILES=$(git diff --staged --name-only)
CHANGED_COUNT=$(printf "%s\n" "$CHANGED_FILES" | sed '/^$/d' | wc -l | tr -d ' ')
{
echo "changed_count=$CHANGED_COUNT"
echo 'changed_files<<EOF'
echo "$CHANGED_FILES"
echo 'EOF'
} >> $GITHUB_OUTPUT
fi

- name: Create PR Branch
if: steps.git-check.outputs.has_changes == 'true'
run: |
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
PR_BRANCH="docs-update/${SOURCE_NAME:-source}-${SOURCE_VERSION:-latest}-$TIMESTAMP"
echo "PR_BRANCH=$PR_BRANCH" >> $GITHUB_ENV

- name: Create Pull Request
if: steps.git-check.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v5
id: create-pr
with:
token: ${{ env.AUTOMATION_TOKEN }}
branch: ${{ env.PR_BRANCH }}
commit-message: |
docs: import documentation from ${{ env.SOURCE_NAME }}

Source: ${{ env.SOURCE_REPO }}@${{ env.SOURCE_COMMIT }}
Version: ${{ env.SOURCE_VERSION }}
Files changed: ${{ steps.git-check.outputs.changed_count }}

Auto-imported via GitHub Actions
committer: DevPortal Documentation Bot <[email protected]>
delete-branch: true
title: "Documentation Update: ${{ env.SOURCE_NAME }}"
body: |
## 📚 Documentation Import

This PR contains automated documentation updates from **${{ env.SOURCE_REPO }}**.

### Source Information
- **Repository**: `${{ env.SOURCE_REPO }}`
- **Version**: `${{ env.SOURCE_VERSION }}`
- **Commit**: `${{ env.SOURCE_COMMIT }}`
- **Branch**: `${{ env.SOURCE_BRANCH }}`
- **Files Changed**: ${{ steps.git-check.outputs.changed_count }}

### Trigger Details
- **Event Type**: ${{ github.event_name }}
- **Triggered At**: ${{ github.event.client_payload.timestamp || github.event.repository.updated_at }}
${{ github.event.client_payload.reason && format('- **Reason**: {0}', github.event.client_payload.reason) || '' }}

### Review Checklist
- [ ] Documentation structure looks correct
- [ ] No unexpected files were modified
- [ ] Links and references are working
- [ ] Version information is accurate

---
*This PR was automatically generated by the DevPortal documentation import workflow.*
labels: |
documentation
automated
import
assignees: ""
reviewers: ""
team-reviewers: ""
draft: false

- name: Add PR Comment
if: steps.git-check.outputs.has_changes == 'true' && steps.create-pr.outputs.pull-request-number
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ env.AUTOMATION_TOKEN }}
issue-number: ${{ steps.create-pr.outputs.pull-request-number }}
body: |
### 🔍 Import Summary

<details>
<summary>Changed Files</summary>

```
${{ steps.git-check.outputs.changed_files }}
```
</details>

<details>
<summary>Import Configuration</summary>

```json
{
"source_repo": "${{ env.SOURCE_REPO }}",
"version": "${{ env.SOURCE_VERSION }}",
"branch": "${{ env.SOURCE_BRANCH }}",
"commit": "${{ env.SOURCE_COMMIT }}"
}
```
</details>

To merge this PR:
1. Review the changed files
2. Verify documentation renders correctly
3. Approve and merge

- name: Summary
if: always()
run: |
if [ "${{ steps.git-check.outputs.has_changes }}" = "true" ]; then
echo "✅ Documentation import completed successfully"
echo "📝 Pull Request created: #${{ steps.create-pr.outputs.pull-request-number }}"
echo "🔗 PR URL: ${{ steps.create-pr.outputs.pull-request-url }}"
echo "## Documentation Import Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Source**: \`$SOURCE_REPO\`" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: \`$SOURCE_VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "- **PR**: #${{ steps.create-pr.outputs.pull-request-number }}" >> $GITHUB_STEP_SUMMARY
echo "- **Status**: ✅ Success" >> $GITHUB_STEP_SUMMARY
elif [ "${{ steps.git-check.outputs.has_changes }}" = "false" ]; then
echo "✅ Documentation import completed - no changes detected"
echo "ℹ️ The documentation is already up to date"
echo "## Documentation Import Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Source**: \`$SOURCE_REPO\`" >> $GITHUB_STEP_SUMMARY
echo "- **Version**: \`$SOURCE_VERSION\`" >> $GITHUB_STEP_SUMMARY
echo "- **Status**: ℹ️ No changes needed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Documentation import failed"
exit 1
fi
14 changes: 1 addition & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,13 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Setup Python for importing docs
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
node-version: "20"

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.3

- name: Setup submodules
run: git submodule update --init


- name: Install dependencies
run: pnpm install

Expand Down
Loading
Loading