Skip to content

Commit 75b9233

Browse files
authored
Merge branch 'mjs/eamxx/clang-format-quickfix' (PR #7677)
Correct diff file name in summary output [BFB]
2 parents 2ede2e3 + a904479 commit 75b9233

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

.github/workflows/eamxx-gh-clang-format.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: |
6060
flist="${{ steps.changed-files.outputs.all_changed_files }}"
6161
run_cfmt () {
62-
clang-format -i --style=file:"components/eamxx/.clang-format" $1
62+
clang-format -i --style=file:"components/eamxx/.clang-format" $1
6363
}
6464
clang-format --version
6565
for f in ${flist[@]}; do
@@ -109,23 +109,8 @@ jobs:
109109
"branch." >> "${GITHUB_STEP_SUMMARY}"
110110
echo "Then commit the changes and push to your remote branch." >> "${GITHUB_STEP_SUMMARY}"
111111
echo "" >> "${GITHUB_STEP_SUMMARY}"
112-
echo "For diffs with ***fewer than 10 files***, we also include the text of " \
112+
echo "For diffs with ***fewer than 100 lines***, we also include the text of " \
113113
"the patch file in a collapsed section, below." >> "${GITHUB_STEP_SUMMARY}"
114-
if [[ $(wc -l < diffiles.txt) -lt 10 ]]; then
115-
echo "<details>" >> "${GITHUB_STEP_SUMMARY}"
116-
echo "" >> "${GITHUB_STEP_SUMMARY}"
117-
echo "<summary>" >> "${GITHUB_STEP_SUMMARY}"
118-
echo "### Contents of \`clang-format-patch.diff\`" >> "${GITHUB_STEP_SUMMARY}"
119-
echo "</summary>" >> "${GITHUB_STEP_SUMMARY}"
120-
echo "To apply this version of the patch, save the text to a local file, " \
121-
"and \`git apply <patch-file>\`, etc., as above." >> "${GITHUB_STEP_SUMMARY}"
122-
echo "" >> "${GITHUB_STEP_SUMMARY}"
123-
echo "\`\`\`" >> "${GITHUB_STEP_SUMMARY}"
124-
cat clang-format-patch.diff >> "${GITHUB_STEP_SUMMARY}"
125-
echo "\`\`\`" >> "${GITHUB_STEP_SUMMARY}"
126-
echo "" >> "${GITHUB_STEP_SUMMARY}"
127-
echo "</details>" >> "${GITHUB_STEP_SUMMARY}"
128-
fi
129114
else
130115
echo "status_fail=false" >> "${GITHUB_ENV}"
131116
echo "## Status: \`clang-format\` Check Passed!" > "${GITHUB_STEP_SUMMARY}"
@@ -136,10 +121,21 @@ jobs:
136121
fname="clang-format-patch_${{ github.event.pull_request.number || github.event_name }}-${d_str}.diff"
137122
echo "fname=${fname}" >> "${GITHUB_ENV}"
138123
git diff > "components/eamxx/${fname}"
139-
- name: debug diff
140-
run: |
141-
echo "${fname}"
142-
tail -10 "components/eamxx/${fname}"
124+
if [[ ${status_fail} = true ]] && [[ $(wc -l < "components/eamxx/${fname}") -lt 100 ]]; then
125+
echo "<details>" >> "${GITHUB_STEP_SUMMARY}"
126+
echo "" >> "${GITHUB_STEP_SUMMARY}"
127+
echo "<summary>" >> "${GITHUB_STEP_SUMMARY}"
128+
echo "<b>Contents of</b> <tt>clang-format-patch.diff</tt>" >> "${GITHUB_STEP_SUMMARY}"
129+
echo "</summary>" >> "${GITHUB_STEP_SUMMARY}"
130+
echo "To apply this version of the patch, save the text to a local file, " \
131+
"and <tt>git apply &lt;patch-file&gt;</tt>, etc., as above." >> "${GITHUB_STEP_SUMMARY}"
132+
echo "" >> "${GITHUB_STEP_SUMMARY}"
133+
echo "\`\`\`" >> "${GITHUB_STEP_SUMMARY}"
134+
cat "components/eamxx/${fname}" >> "${GITHUB_STEP_SUMMARY}"
135+
echo "\`\`\`" >> "${GITHUB_STEP_SUMMARY}"
136+
echo "" >> "${GITHUB_STEP_SUMMARY}"
137+
echo "</details>" >> "${GITHUB_STEP_SUMMARY}"
138+
fi
143139
- name: upload diff patch
144140
if: ${{ env.status_fail == 'true' }}
145141
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)