ci: api.jsonの差分がない時は折りたたみを生成しないようにする (#14598)
This commit is contained in:
parent
d4d15f338e
commit
9cd784cdee
29
.github/workflows/report-api-diff.yml
vendored
29
.github/workflows/report-api-diff.yml
vendored
@ -70,18 +70,27 @@ jobs:
|
||||
- id: out-diff
|
||||
name: Build diff Comment
|
||||
run: |
|
||||
cat <<- EOF > ./output.md
|
||||
このPRによるapi.jsonの差分
|
||||
<details>
|
||||
<summary>差分はこちら</summary>
|
||||
HEADER="このPRによるapi.jsonの差分"
|
||||
FOOTER="[Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})"
|
||||
DIFF_BYTES="$(stat ./api.json.diff -c '%s' | tr -d '\n')"
|
||||
|
||||
\`\`\`diff
|
||||
$(cat ./api.json.diff)
|
||||
\`\`\`
|
||||
</details>
|
||||
echo "$HEADER" > ./output.md
|
||||
|
||||
[Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})
|
||||
EOF
|
||||
if (( "$DIFF_BYTES" <= 1 )); then
|
||||
echo '差分はありません。' >> ./output.md
|
||||
else
|
||||
cat <<- EOF >> ./output.md
|
||||
<details>
|
||||
<summary>差分はこちら</summary>
|
||||
|
||||
\`\`\`diff
|
||||
$(cat ./api.json.diff)
|
||||
\`\`\`
|
||||
</details>
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo "$FOOTER" >> ./output.md
|
||||
- uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
pr_number: ${{ steps.load-pr-num.outputs.pr-number }}
|
||||
|
Loading…
Reference in New Issue
Block a user