docs: migrate 8 README files to a single NRG template #1
Workflow file for this run
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: Regenerate READMEs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'README.src.md' | |
| - '.github/workflows/nrg.yml' | |
| pull_request: | |
| paths: | |
| - 'README.md' | |
| - 'README.de.md' | |
| - 'README.es.md' | |
| - 'README.fr.md' | |
| - 'README.hi.md' | |
| - 'README.ko.md' | |
| - 'README.pt_br.md' | |
| - 'README.zh_tw.md' | |
| - 'README.src.md' | |
| permissions: | |
| contents: write | |
| jobs: | |
| regenerate: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: nanolaba/nrg-action@v1 | |
| with: | |
| file: README.src.md | |
| nrg-version: '1.1' | |
| - name: Commit regenerated READMEs | |
| run: | | |
| if [ -n "$(git status --porcelain README.md README.de.md README.es.md README.fr.md README.hi.md README.ko.md README.pt_br.md README.zh_tw.md)" ]; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md README.de.md README.es.md README.fr.md README.hi.md README.ko.md README.pt_br.md README.zh_tw.md | |
| git commit -m "docs: regenerate READMEs from README.src.md" | |
| git push | |
| fi | |
| drift-check: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: nanolaba/nrg-action@v1 | |
| with: | |
| file: README.src.md | |
| mode: check | |
| nrg-version: '1.1' |