Skip to content

Commit 5b721ae

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

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

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

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ jobs:
1111
with:
1212
fetch-depth: 0
1313
ref: ${{ github.event.pull_request.head.sha }}
14+
- name: Fetch base_ref HEAD
15+
run: git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
1416
- name: Run clang-format
15-
shell: bash
16-
run: git clang-format-16 --diff ${{ github.base_ref }}
17+
run: |
18+
echo "clang_format_diff=$(git clang-format-16 --diff ${{ github.base_ref }})" >> $GITHUB_OUTPUT
19+
id: run_clang_format
20+
- uses: actions/github-script@v7
21+
with:
22+
script: |
23+
octokit.rest.issues.createComment({
24+
issue_number: context.issue.number,
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
body: ${{ steps.run_clang_format.outputs.clang_format_diff }}
28+
})

0 commit comments

Comments
 (0)