# GitHub Actions Docs that write themselves every time you push. ## In plain words An “Action” is a program GitHub runs on events in your repo. This one wakes on every push, documents the files you changed, and saves the docs back next to the code. **Put another way:** A colleague who tidies the docs after every commit, and never forgets or takes a day off. ## Reach for it when - You keep changing code and meaning to update the docs later. - You want documentation to live in the repository, beside the code, not on a website. - You want a pull request to tell you when a doc no longer matches the code. ## Setting it up 1. **Get your key**: Sign in, open the dashboard, and go to API Keys → Create key — the string starts with writ_ and is shown only once. 2. **Give GitHub the key**: Settings → Secrets and variables → Actions → New repository secret; name it WRITULOS_API_KEY and paste the key in. GitHub stores it privately and never logs it. 3. **Add one file**: Create .github/workflows/writulos-docs.yml and paste the block below in — that's the entire installation. 4. **Document what is already there**: Your repository → Actions → Writulos Auto-Docs → Run workflow: a one-time scan that documents everything you already have. 5. **Then forget about it**: From here on, every push documents only the files that changed. .github/workflows/writulos-docs.yml: ``` name: Writulos Auto-Docs on: # "Run workflow" button: documents your whole existing repo in one go. # One generation per file, so max_files below caps what a run can spend. workflow_dispatch: push: branches: [main, master] paths: ['**.js', '**.ts', '**.tsx', '**.jsx', '**.py', '**.java', '**.kt', '**.scala', '**.go', '**.rb'] pull_request: paths: ['**.js', '**.ts', '**.tsx', '**.jsx', '**.py', '**.java', '**.kt', '**.scala', '**.go', '**.rb'] jobs: docs: runs-on: ubuntu-latest permissions: contents: write pull-requests: write steps: - uses: actions/checkout@v7 with: # Full history, so doc-drift can count commits since each doc. fetch-depth: 0 - uses: writulos/scribe-action@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} writulos_api_key: ${{ secrets.WRITULOS_API_KEY }} # Most files one run may document. Raise it, or use '0' for no cap. max_files: '25' ``` ## What you end up with - Markdown docs appear in docs/, laid out to mirror your source tree. - Every doc records the exact commit it was written from. - A pull request that touches an already-documented file gets an inline warning when its doc has fallen behind. - Each file documented costs one generation from your monthly allowance. ## Things people ask ### Could a big repository use up my whole month at once? No — max_files: '25' caps any single run at 25 files. Run it again for the next batch, raise the number, or set '0' to remove the cap. ### Does it work on a private repository? Yes — it runs in your own CI, and only the file being documented ever leaves it. ### I don't want it committing straight to my branch. Add mode: 'pr' to open a pull request instead, or mode: 'comment' to only comment on the PR with what it would have documented. ### Can I make stale docs block a merge? Yes — add fail_on_drift: 'true' to fail the job on stale docs instead of warning. Keep fetch-depth: 0 on checkout, or there's no history to count. ### It only documents JavaScript-ish files. Defaults to .js .ts .jsx .tsx .py .java .kt .scala .go .rb; add file_extensions: 'rs,php,swift' for anything else. ## Try it on one file first. The web app needs no key or sign-up — see what comes out before you wire anything up. [Try it now →](https://scribe.writulos.com/app)