Skip to content

Commit 58420ec

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

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,15 @@ 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+
echo "CLANG_FORMAT_DIFF=$(git clang-format-16 --diff origin/${{ github.base_ref }})" >> $GITHUB_ENV
17+
id: run_clang_format
18+
- uses: actions/github-script@v7
19+
with:
20+
script: |
21+
octokit.rest.issues.createComment({
22+
issue_number: context.issue.number,
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
body: $CLANG_FORMAT_DIFF
26+
})

0 commit comments

Comments
 (0)