Skip to content

Commit d6eb02d

Browse files
committed
Sketch: generate diagram and save to a new branch
1 parent 832e38d commit d6eb02d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/lint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,17 @@ jobs:
2323
run: npm install
2424
- name: Run the linter
2525
run: ./lint
26+
- name: Create the diagram
27+
run: ./diagram > diagram.md
28+
- name: Save the diagram
29+
run: |
30+
git add diagram.md
31+
git status
32+
git remote -v
33+
new_branch="${{ github.ref_name }}-diagram"
34+
git branch -D "${new_branch}" || :
35+
git checkout -b "${new_branch}"
36+
git config user.name "${{ github.workflow }}"
37+
git config user.email "[email protected]"
38+
git commit -m "Diagram saved by lint.yml workflow"
39+
git push --set-upstream "$( git remote )" --force "${new_branch}"

diagram

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
cat <<MERMAID
6+
\`\`\`mermaid
7+
graph TD;
8+
A-->B;
9+
A-->C;
10+
B-->D;
11+
C-->D;
12+
D-->E;
13+
E["generated at $( date )"]
14+
\`\`\`
15+
MERMAID

0 commit comments

Comments
 (0)