Skip to content

Commit 7cdfc27

Browse files
Fix YAML formatting in workflow file - remove trailing spaces
Co-authored-by: reindervdw-cmi <200102462+reindervdw-cmi@users.noreply.github.com>
1 parent a87b015 commit 7cdfc27

1 file changed

Lines changed: 23 additions & 20 deletions

File tree

.github/workflows/d2-diagrams.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,72 +19,75 @@ permissions:
1919
jobs:
2020
build-diagrams:
2121
runs-on: ubuntu-latest
22-
22+
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v4
26-
26+
2727
- name: Install D2
2828
run: |
2929
curl -fsSL https://d2lang.com/install.sh | sh -s --
3030
sudo mv ./bin/d2 /usr/local/bin/
31-
31+
3232
- name: Build D2 diagrams
3333
run: |
3434
mkdir -p diagrams/output
3535
d2 diagrams/main.d2 diagrams/output/architecture.svg
3636
echo "✅ Generated architecture.svg"
37-
37+
3838
- name: Upload diagram as artifact
3939
uses: actions/upload-artifact@v4
4040
with:
4141
name: architecture-diagram
4242
path: diagrams/output/architecture.svg
4343
retention-days: 90
44-
44+
4545
- name: Post diagram to PR comment
4646
if: github.event_name == 'pull_request'
4747
uses: actions/github-script@v7
4848
with:
4949
script: |
5050
const fs = require('fs');
5151
const path = require('path');
52-
52+
5353
// Read the SVG file
54-
const svgPath = path.join(process.env.GITHUB_WORKSPACE, 'diagrams/output/architecture.svg');
54+
const svgPath = path.join(
55+
process.env.GITHUB_WORKSPACE,
56+
'diagrams/output/architecture.svg'
57+
);
5558
const svgContent = fs.readFileSync(svgPath, 'utf8');
56-
59+
5760
// Create comment body with embedded SVG
5861
const commentBody = `## 🏗️ Architecture Diagram Updated
59-
62+
6063
The D2 architecture diagram has been regenerated based on the changes in this PR.
61-
64+
6265
### Production Architecture
63-
66+
6467
<details>
6568
<summary>Click to view diagram</summary>
66-
69+
6770
${svgContent}
68-
71+
6972
</details>
70-
73+
7174
---
72-
75+
7376
📥 You can also download the diagram from the [workflow artifacts](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).
7477
`;
75-
78+
7679
// Find existing comment
7780
const comments = await github.rest.issues.listComments({
7881
owner: context.repo.owner,
7982
repo: context.repo.repo,
8083
issue_number: context.issue.number,
8184
});
82-
83-
const botComment = comments.data.find(comment =>
84-
comment.user.type === 'Bot' &&
85+
86+
const botComment = comments.data.find(comment =>
87+
comment.user.type === 'Bot' &&
8588
comment.body.includes('🏗️ Architecture Diagram Updated')
8689
);
87-
90+
8891
// Update or create comment
8992
if (botComment) {
9093
await github.rest.issues.updateComment({

0 commit comments

Comments
 (0)