Build Readme #9436
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: Build Readme | |
| on: | |
| push: | |
| workflow_dispatch: # This lets you trigger the workflow manually | |
| schedule: | |
| - cron: "0 * * * *" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" # Not needed with a `.ruby-version` or `.tool-versions` | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - run: bundle exec ruby generate.rb | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is from gh-auth-token and set in the repo secrets | |
| - name: Commit and push if README changed | |
| run: |- | |
| git pull origin main | |
| git diff | |
| git config --global user.email "readme-bot@example.com" | |
| git config --global user.name "README-bot" | |
| git add . | |
| git commit -m "Updated content" || exit 0 | |
| git push | |
| env: | |
| GH_TOKEN: ${{ secrets.FOCUS_TOKEN }} |