chore: adjust bracket generator rule #122
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: Update Architecture Diagram | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - 'app/modules/**' | |
| - 'app/models/**' | |
| - 'app/controllers/**' | |
| - 'config/routes.rb' | |
| - 'Gemfile' | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - 'app/modules/**' | |
| - 'app/models/**' | |
| - 'app/controllers/**' | |
| - 'config/routes.rb' | |
| - 'Gemfile' | |
| workflow_dispatch: | |
| jobs: | |
| update-diagram: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1 | |
| with: | |
| ruby-version: '3.4.5' | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: bundle install --jobs 4 --retry 3 | |
| - name: Update architecture diagram | |
| run: | | |
| ruby scripts/update_architecture_diagram.rb | |
| - name: Check for changes | |
| id: verify_diff | |
| run: | | |
| if git diff --quiet README.md; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push if changed | |
| if: steps.verify_diff.outputs.changed == 'true' | |
| env: | |
| BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout "$BRANCH_NAME" | |
| git add README.md | |
| git commit -m "docs: auto-update architecture diagram [skip ci]" | |
| git push |