Skip to content

Commit 0500222

Browse files
committed
chore(workflows/preview_link): 表示件数上限を100から50に削減、他体裁調整
1 parent d32a312 commit 0500222

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
set -ex
124124
125125
# config
126-
threshold_nitem=100 # コメントの変更ファイル一覧内の最大ファイル数
126+
threshold_nitem=50 # コメントの変更記事一覧内の最大ファイル数
127127
threshold_details=20 # <details> を使って折りたたむ閾値
128128
129129
git remote add base '${{ github.event.pull_request.base.repo.clone_url }}'
@@ -148,24 +148,24 @@ jobs:
148148
[[ $content ]] || content='- (内容変更された `.md` ファイルはありません)'
149149
nitem=$(wc -l <<< "$content")
150150
if ((nitem > threshold_nitem)); then
151-
content=$nitem'件のファイルが変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。
152-
<details><summary>(変更ファイル一覧)</summary>
151+
content=$nitem'件の記事が変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。
152+
<details><summary>(ファイル一覧)</summary>
153153
154154
'$(head -n "$((threshold_nitem-1))" <<< "$content")'
155155
- … (以下省略)
156156
157157
</details>'
158158
159159
elif ((nitem > threshold_details)); then
160-
content=$nitem'件のファイルが変更されました
161-
<details><summary>(変更ファイル一覧)</summary>
160+
content=$nitem'件の記事が変更されました
161+
<details><summary>(ファイル一覧)</summary>
162162
163163
'$content'
164164
165165
</details>'
166166
167167
else
168-
content=$nitem'件のファイルが変更されました
168+
content=$nitem'件の記事が変更されました
169169
170170
'$content
171171

.github/workflows/script/build.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ elif [[ $1 == --pull ]]; then
8686
git fetch base "$base_git_ref"
8787
fi
8888

89-
echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー"
90-
echo "- &#x231a; 更新時刻: $time"
91-
echo "- &#x1f50d; [プレビュー (HTML)]($preview_base_url)"
92-
echo "- &#x1f4c8; [プレビュー生成記録]($preview_repo_url/actions?query=event%3Apull_request_target+branch%3A$preview_ubranch)"
93-
echo "- **&#x2AEF;** ソースの変更: [\`${commit_base::7}..${commit_head::7}\`]($preview_repo_url/compare/$commit_base..$commit_head)"
94-
echo
95-
echo "## 変更記事一覧"
96-
echo
9789
content=$(
9890
git diff --name-status --diff-filter=dr "$commit_base" "$commit_head" |
9991
sed -n '
@@ -111,7 +103,17 @@ elif [[ $1 == --pull ]]; then
111103
s|^[^[:space:]]* \(.*\)\.md$|- \&#x1f4dd; [`\1`]('"$preview_base_url"'/\1.html)|p
112104
'
113105
)
106+
nitem=$(wc -l <<< "$content")
114107
[[ $content ]] || content='- (内容変更された `.md` ファイルはありません)'
108+
109+
echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー"
110+
echo "- &#x231a; 更新時刻: $time"
111+
echo "- &#x1f50d; [プレビュー (HTML)]($preview_base_url)"
112+
echo "- &#x1f4c8; [プレビュー生成記録]($preview_repo_url/actions?query=event%3Apull_request_target+branch%3A$preview_ubranch)"
113+
echo "- **&#x2AEF;** ソースの変更: [\`${commit_base::7}..${commit_head::7}\`]($preview_repo_url/compare/$commit_base..$commit_head)"
114+
echo
115+
echo "## 変更記事一覧 (${nitem}件)"
116+
echo
115117
echo "$content"
116118

117119
) > "$target_directory"/PREVIEW.md

0 commit comments

Comments
 (0)