Skip to content

Update create-diagram.yml #1569

Update create-diagram.yml

Update create-diagram.yml #1569

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: |
repo-visualizer \
--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