Skip to content

Commit 8a81d6f

Browse files
committed
#2378: ci: post comment with clang-format output
1 parent b92c488 commit 8a81d6f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/run-clang-format.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,18 @@ jobs:
1212
fetch-depth: 0
1313
ref: ${{ github.event.pull_request.head.sha }}
1414
- name: Run clang-format
15-
shell: bash
16-
run: git clang-format-16 --diff ${{ github.base_ref }}
15+
run: |
16+
{
17+
echo 'CLANG_FORMAT_DIFF<<EOF'
18+
git clang-format-16 --diff origin/${{ github.base_ref }} || true
19+
echo EOF
20+
} >> "$GITHUB_ENV"
21+
- uses: actions/github-script@v7
22+
with:
23+
script: |
24+
github.rest.issues.createComment({
25+
issue_number: context.issue.number,
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
body: "$CLANG_FORMAT_DIFF"
29+
})

0 commit comments

Comments
 (0)