-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (87 loc) · 3.35 KB
/
pull-requests.yml
File metadata and controls
92 lines (87 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Pull Requests
on:
pull_request:
jobs:
# # https://qiita.com/hedrall/items/e5507dbec5429c69616f
# dependency_cruise:
# name: 'Dependency Cruiser'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: oven-sh/setup-bun@v1
# - name: Install dependencies
# run: bun install --frozen-lockfile
# - name: 1. dependency-cruiserを実行する
# run: bunx depcruise --config .dependency-cruiser.js -T json src > result.json
# - name: 2. 結果を標準出力する
# run: bunx depcruise-fmt -T err result.json
# - name: 3. Markdown出力用のファイルを作成し、タイトルを書き込む
# run: echo '# dependency-cruiserによる依存関係分析結果' > comment.md
# - name: 4. 結果をMarkdowでファイルに書き込む
# run: bunx depcruise-fmt -T markdown result.json >> comment.md
# - name: 5. find-commentを利用して、既存の自動コメントがあれば置き換えます
# uses: peter-evans/find-comment@v2
# continue-on-error: true
# id: fc
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: dependency-cruiserによる依存関係分析結果
# - name: 6. コメントを投稿する
# uses: peter-evans/create-or-update-comment@v2
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# body-file: comment.md
# edit-mode: replace
# token: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/MH4GF/dependency-cruiser-report-action
report:
name: 'Visualize dependenices of changed files'
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: MH4GF/dependency-cruiser-report-action@v2.4.0
with:
package-manager: bun
# # https://github.com/MH4GF/dependency-cruiser-report-action
# report2:
# permissions:
# pull-requests: write
# runs-on: ubuntu-latest
# steps:
# - uses: MH4GF/dependency-cruiser-report-action@v2
# with:
# cruise-script: yarn run -s depcruise src
depcruise:
name: 'Dependency Cruiser report'
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install bun
uses: oven-sh/setup-bun@v1
- name: bun version
run: bun --version
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Dependency Cruise
run: bunx depcruise src --config --output-type markdown >> comment.md
- name: Dependency Cruise Mermaid block
run: |
echo '----' >> comment.md
echo '# Mermaid block' >> comment.md
echo '```mermaid' >> comment.md
bunx depcruise src --config --output-type mermaid >> comment.md
echo '```' >> comment.md
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
filePath: comment.md
# message: |
# _(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
comment_tag: execution
- name: Dependency Cruise for action state
run: bunx depcruise src --config