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
97 changes: 97 additions & 0 deletions .github/workflows/improve-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# ============================================================================
# Improve Documentation (AI-driven)
# ============================================================================
# Runs daily (or on demand). Pulls the GDevelop repo, reads what has already
# been improved in automated_updates_data.json, and uses an AI agent to
# improve a DIFFERENT aspect of the documentation each run.
#
# To switch from Claude Code to Codex:
# 1. Change AI_PROVIDER to "codex"
# 2. Comment out the "Install Claude Code" step and uncomment "Install Codex"
# 3. Swap the API key secrets (comment ANTHROPIC_API_KEY, uncomment OPENAI_API_KEY)
# ============================================================================

name: "Auto: Improve documentation"

on:
schedule:
- cron: "0 10 * * *" # Every day at 10:00 UTC (offset from the other workflow)
workflow_dispatch: # Manual trigger
pull_request: # For testing in PRs

permissions:
contents: write
pull-requests: write

jobs:
improve-docs:
runs-on: ubuntu-latest
if: github.repository == 'GDevelopApp/GDevelop-documentation'
timeout-minutes: 20

steps:
# ── Checkout this documentation repo ──────────────────────────────
- name: Checkout documentation repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# ── Node.js ───────────────────────────────────────────────────────
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

# ── Install AI CLI ────────────────────────────────────────────────
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

# Uncomment below (and comment above) to use Codex instead:
# - name: Install Codex
# run: npm install -g @openai/codex

# ── Run the improvement script ────────────────────────────────────
- name: Improve documentation
id: improve
env:
AI_PROVIDER: "claude" # Change to "codex" to use Codex
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
node scripts/improve-docs.js

# Pass the AI summary to subsequent steps
if [ -f /tmp/ai_summary.txt ]; then
delimiter="EOF_$(openssl rand -hex 8)"
{
echo "summary<<${delimiter}"
cat /tmp/ai_summary.txt
echo ""
echo "${delimiter}"
} >> "$GITHUB_OUTPUT"
fi

# ── Create Pull Request ───────────────────────────────────────────
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: AI-driven documentation improvement"
title: "Auto: Improve documentation"
body: |
This PR was automatically generated by the **Improve documentation** workflow.

An AI coding agent inspected the [GDevelop](https://github.com/4ian/GDevelop) codebase
and the existing documentation, then chose an aspect to improve.

The AI agent summary is:
> ${{ steps.improve.outputs.summary }}

The updated `automated_updates_data.json` tracks what was improved so future
runs will pick a different area.

**Please review the changes carefully before merging.**
base: main
branch: auto/improve-docs
delete-branch: true
labels: automated,documentation
108 changes: 108 additions & 0 deletions .github/workflows/update-docs-from-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# ============================================================================
# Update Documentation from GDevelop Commits
# ============================================================================
# Runs daily (or on demand). Pulls the GDevelop repo, inspects recent commits
# since the last tracked commit, and uses an AI agent (Claude Code by default,
# Codex as an alternative) to update the docs accordingly.
#
# To switch from Claude Code to Codex:
# 1. Change AI_PROVIDER to "codex"
# 2. Comment out the "Install Claude Code" step and uncomment "Install Codex"
# 3. Swap the API key secrets (comment ANTHROPIC_API_KEY, uncomment OPENAI_API_KEY)
# ============================================================================

name: "Auto: Update docs from GDevelop commits"

on:
schedule:
- cron: "0 8 * * *" # Every day at 08:00 UTC
workflow_dispatch: # Manual trigger
pull_request: # For testing in PRs

permissions:
contents: write
pull-requests: write

jobs:
update-docs:
runs-on: ubuntu-latest
if: github.repository == 'GDevelopApp/GDevelop-documentation'
timeout-minutes: 20

steps:
# ── Checkout this documentation repo ──────────────────────────────
- name: Checkout documentation repo
uses: actions/checkout@v4
with:
fetch-depth: 0

# ── Node.js ───────────────────────────────────────────────────────
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

# ── Install AI CLI ────────────────────────────────────────────────
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

# Uncomment below (and comment above) to use Codex instead:
# - name: Install Codex
# run: npm install -g @openai/codex

# ── Run the update script ─────────────────────────────────────────
- name: Update documentation from recent commits
id: update
env:
AI_PROVIDER: "claude" # Change to "codex" to use Codex
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
node scripts/update-docs-from-commits.js

# Pass the AI summary and commit log to subsequent steps
if [ -f /tmp/ai_summary.txt ]; then
delimiter="EOF_$(openssl rand -hex 8)"
{
echo "summary<<${delimiter}"
cat /tmp/ai_summary.txt
echo ""
echo "${delimiter}"
} >> "$GITHUB_OUTPUT"
fi
if [ -f /tmp/commit_log.txt ]; then
delimiter="EOF_$(openssl rand -hex 8)"
{
echo "commits<<${delimiter}"
cat /tmp/commit_log.txt
echo ""
echo "${delimiter}"
} >> "$GITHUB_OUTPUT"
fi

# ── Create Pull Request ───────────────────────────────────────────
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: auto-update documentation from GDevelop commits"
title: "Auto: Update documentation based on recent GDevelop changes"
body: |
This PR was automatically generated by the **Update docs from GDevelop commits** workflow.

An AI coding agent analysed recent commits in [4ian/GDevelop](https://github.com/4ian/GDevelop)
and updated the documentation to reflect user-facing changes.

### GDevelop commits covered
```
${{ steps.update.outputs.commits }}
```

### The AI agent summary is:
${{ steps.update.outputs.summary }}

**Please review the changes carefully before merging.**
base: main
branch: auto/update-docs-from-commits
delete-branch: true
labels: automated,documentation
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dokuwiki2wikijs/__pycache__
.DS_Store
site
site
scripts/node_modules/
6 changes: 6 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"last_automated_updates_commit": null,
"last_improved_things": [

]
}
Loading
Loading