Update create-diagram.yml #1573
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: Create diagram | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| get_data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install repo-visualizer | |
| run: npm install -g repo-visualizer | |
| - name: Generate diagram | |
| run: node $(npm root -g)/repo-visualizer/bin/repo-visualizer.js --repo-path . --output diagram.svg --exclude "ignore,.github" | |
| - name: Commit diagram changes | |
| id: commit_changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout -B update-diagram-${{ github.run_id }} | |
| git add diagram.svg | |
| git diff --cached --quiet || git commit -m "Repo visualizer: update diagram" | |
| - name: Create Pull Request | |
| if: success() && steps.commit_changes.outcome == 'success' | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| branch: update-diagram-${{ github.run_id }} | |
| title: "Repo visualizer: update diagram" | |
| body: "Automated update of the repo diagram" | |
| base: master |