diff --git a/.github/workflows/regenerate-llms.yml b/.github/workflows/regenerate-llms.yml index 58f1e64..1373992 100644 --- a/.github/workflows/regenerate-llms.yml +++ b/.github/workflows/regenerate-llms.yml @@ -3,7 +3,7 @@ name: Regenerate llms.txt # Refreshes the hand-curated `llms.txt` and `llms-full.txt` at the repo root. # The generator fetches each page's `.md` from the deployed docs site, so this # runs after Mintlify has had time to publish — on a schedule, or on demand. -# If anything changed, opens a PR. +# If anything changed, commits the result straight to main. # # Triggers: # - workflow_dispatch (manual) @@ -16,7 +16,6 @@ on: permissions: contents: write - pull-requests: write defaults: run: @@ -41,32 +40,17 @@ jobs: - name: Show diff (for log visibility) run: git --no-pager diff --stat -- llms.txt llms-full.txt || true - - name: Open pull request if changed - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: bot/regenerate-llms - base: main - commit-message: 'docs: regenerate llms.txt and llms-full.txt' - title: 'docs: regenerate llms.txt and llms-full.txt' - body: | - Auto-generated by [`regenerate-llms.yml`](.github/workflows/regenerate-llms.yml). - - Re-runs `scripts/generate-llms.mjs`, which reads `docs.json`, fetches - each page's auto-generated `.md` from https://docs.sei.io, and - re-emits the curated `llms.txt` / `llms-full.txt` at the repo root. - - ## What is the purpose of the change? - Keep the LLM-facing index and full-content dump in sync with the - live docs so AI agents and crawlers see the latest structure. - - ## Notes - If this PR is empty, no page content (titles, descriptions, or - bodies) has changed since the last run. - labels: | - documentation - automated - add-paths: | - llms.txt - llms-full.txt - delete-branch: true + - name: Commit and push to main if changed + run: | + set -euo pipefail + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + if git diff --quiet -- llms.txt llms-full.txt; then + echo 'No changes to llms.txt / llms-full.txt; nothing to commit.' + exit 0 + fi + git add llms.txt llms-full.txt + git commit -m 'docs: regenerate llms.txt and llms-full.txt' + # Rebase onto any concurrent pushes before writing back to main. + git pull --rebase --autostash origin main + git push origin HEAD:main diff --git a/.github/workflows/sync-default-configs.yml b/.github/workflows/sync-default-configs.yml index 22db5c8..b2ebd89 100644 --- a/.github/workflows/sync-default-configs.yml +++ b/.github/workflows/sync-default-configs.yml @@ -3,7 +3,7 @@ name: Sync default seid configs # Rebuilds the latest tagged seid release, runs `seid init`, and pipes the # resulting app.toml / config.toml / client.toml into the inlined "Default # Configurations" section of node/node-operators.mdx. If anything changed, -# opens a PR. +# commits the result straight to main. # # Triggers: # - workflow_dispatch (manual; can override the seid version) @@ -22,7 +22,6 @@ on: permissions: contents: write - pull-requests: write defaults: run: @@ -109,36 +108,19 @@ jobs: - name: Show diff (for log visibility) run: git --no-pager diff --stat -- node/node-operators.mdx || true - - name: Open pull request if changed - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: bot/sync-default-configs - base: main - commit-message: 'docs(node): sync default configs from seid ${{ steps.version.outputs.tag }}' - title: 'docs(node): sync default configs from seid ${{ steps.version.outputs.tag }}' - body: | - Auto-generated by [`sync-default-configs.yml`](.github/workflows/sync-default-configs.yml). - - Refreshes the inlined "Default Configurations" tabs in - `node/node-operators.mdx` from a fresh `seid init` - against [`sei-chain@${{ steps.version.outputs.tag }}`](https://github.com/sei-protocol/sei-chain/releases/tag/${{ steps.version.outputs.tag }}) - (commit `${{ steps.commit.outputs.sha }}`). - - ## What is the purpose of the change? - Keep the documented default `app.toml`, `config.toml`, and - `client.toml` in sync with what node operators actually get when - they install the latest `seid`. - - ## Describe the changes to the documentation - Updates the marker-bounded TOML blocks inside - `node/node-operators.mdx`. No hand-written prose is touched. - - ## Notes - If this PR is empty, no defaults changed in the new release. - labels: | - documentation - automated - add-paths: | - node/node-operators.mdx - delete-branch: true + - name: Commit and push to main if changed + env: + SEI_VERSION: ${{ steps.version.outputs.tag }} + run: | + set -euo pipefail + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + if git diff --quiet -- node/node-operators.mdx; then + echo 'No changes to node/node-operators.mdx; nothing to commit.' + exit 0 + fi + git add node/node-operators.mdx + git commit -m "docs(node): sync default configs from seid ${SEI_VERSION}" + # Rebase onto any concurrent pushes before writing back to main. + git pull --rebase --autostash origin main + git push origin HEAD:main