Merge pull request #2260 from evalstate/sep/unsolicitited-req #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Render SEPs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "seps/**/*.md" | |
| - "scripts/render-seps.ts" | |
| pull_request: | |
| paths: | |
| - "seps/**/*.md" | |
| - "scripts/render-seps.ts" | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| render-seps: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| # On PR, verify rendered docs are up to date (must run BEFORE generate) | |
| - name: Verify SEPs are up to date | |
| if: github.event_name == 'pull_request' | |
| run: npm run check:seps | |
| # On push to main, generate and commit any changes | |
| - name: Render SEPs | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| run: npm run generate:seps | |
| - name: Check for changes | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| id: changes | |
| run: | | |
| if [[ -n "$(git status --porcelain docs/community/seps/ docs/docs.json)" ]]; then | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit changes | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.changes.outputs.has_changes == 'true' | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add docs/community/seps/ docs/docs.json | |
| git commit -m "docs: auto-render SEPs documentation" | |
| git push |