mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
run clang-format as a pull request hook
This commit is contained in:
parent
261631a6e1
commit
6317db5ccb
1 changed files with 22 additions and 0 deletions
22
.github/workflows/clangformat.yml
vendored
Normal file
22
.github/workflows/clangformat.yml
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
on: [pull_request]
|
||||||
|
name: clang-format
|
||||||
|
jobs:
|
||||||
|
check-clang-format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: fetch target ref
|
||||||
|
run:
|
||||||
|
|
|
||||||
|
refs=($(git log -1 --format=%s))
|
||||||
|
git fetch --depth=1 origin "${refs[3]}"
|
||||||
|
- name: run git-clang-format and Check if no changes are needed
|
||||||
|
run:
|
||||||
|
|
|
||||||
|
git-clang-format-9 --diff FETCH_HEAD HEAD | tee git-clang-format.diff
|
||||||
|
cmp -s <(echo no modified files to format) git-clang-format.diff
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: git-clang-format.diff
|
||||||
|
path: git-clang-format.diff
|
||||||
Loading…
Add table
Add a link
Reference in a new issue